DEPARTMENT OF COMPUTING

CS 3005: Programming in C++

Questions 3

In this assignment, you will create a program that asks the user three questions, and gives output based on the answers to those questions. No knights should be harmed in the creation of this program.

Some of the code you create in this assignment will be used in the rest of the assignments.

The actual program you will build is rather simple. You should be concentrating on the process of editing, compiling, linking, running, committing and pushing your program. It would be wise to update your set of notes to guide you through this process as you complete future assignments this semester.

Assignment

Create a program, following the programming requirements listed below. This program will ask the user their favorite color, favorite integer number, and favorite floating point number. It will then display lines of output based on the user’s responses to these questions. In particular, each line will contain 3 pieces of information:

The number of lines will be controlled by the favorite integer number. If the favorite integer number is 0 or less, then no lines will be displayed.

Potential Session

$ ./questions_3 
What is your favorite color? Teal
What is your favorite integer? 6
What is your favorite number? 3.14
1 Teal 3.14
2 Teal 3.14
3 Teal 3.14
4 Teal 3.14
5 Teal 3.14
6 Teal 3.14

Programming Requirements

The following files must be created and stored in the src directory of your repository.

Create image_menu.h

This file must include declarations of the following functions:

Create user_io.cpp

This file must include the implementations of the following functions:

Create controllers.cpp

This file must include the implementations of the following functions:

Create questions_3.cpp

This file must include the implementations of the following functions:

Update Makefile

This file must now also include the rules to build the program questions_3. The following commands should work correctly. You’ll need to know about the all target.

Additional Documentation

Show Off Your Work

To receive credit for this assignment, you must:

Additionally, the program must build, run and give the correct output.

Last Updated 01/22/2024