DEPARTMENT OF COMPUTING

CS 3005: Programming in C++

User Interaction

Introduction

Interactive applications need to send text messages to users and receive text messages from users. We will create a class to help us manage these interactions. The class will keep track of the input and output streams used to communicate with the user, and standardize our interactions.

Assignment

Create a program that will ask the user for an integer (int), a floating point number (double), and a word (std::string). The program then should display a number of lines of text based on the value of the integer. For example, if the integer is 5, there will be 5 lines of text. If the integer is 0 or less, there will be 0 lines of text. The program will have an exit status (return value from main) that is equal to the user’s integer.

Each line of text will have this format:

int double word

Where int is the line number, starting at 1, double is the user’s floating point input, and word is the user’s word input.

For example, the program interaction may look like this:

$ ./questions3
Favorite integer? 3
Favorite double? 1.23
Favorite word? yellow
1 1.23 yellow
2 1.23 yellow
3 1.23 yellow

Programming Requirements

You must create following classes and functions, in the required locations, with the required API and functionality.

Create lib/.gitignore

Create a directory named lib. This will store the libraries of object code you will build for this project.

The file lib/.gitignore needs to store one line of text:

*.a

This will prevent the library files, which are derived files from being committed to the repository. We will always build them in the working directory.

Create include/.gitignore

Create a directory named include. This will store the header files for all of the files in the lib directory.

The file include/.gitignore needs to store one line of text:

*.h

This will prevent these copies of the header files, which are derived files from being committed to the repository. We will always maintain the originals in other directories.

Create library-application/ApplicationData.{h,cpp}

ApplicationData Class

Data Members:

public Methods:

Create library-application/Makefile

This file must contain rules such that any of the following commands will build the libapplication.a library:

This file must contain rules such that the following command will install the libapplication.a library into the ../lib directory, and ApplicationData.h into the ../include:

Create library-commands/questions3_aux.{h,cpp}

Functions:

Create library-commands/Makefile

This file must contain rules such that any of the following commands will build the libcommands.a library:

This file must contain rules such that the following command will install the libcommands.a library into the ../lib directory, and questions3_aux.h into the ../include:

Create program-questions3/questions3.cpp

Functions:

Create program-questions3/Makefile

This file must contain rules such that any of the following commands will build the questions3 program:

Create program-questions3/.gitignore

The file program-questions3/.gitignore needs to store one line of text:

questions3

This will prevent the executable program questions3 from being committed to the repository. It is a derived file.

Update Makefile

Update the project-level Makefile so that make and make all in the project directory will call make install in the library-application and library-commands directories, and make in the program-questions3 directory.

Additional Documentation

Grading Instructions

To receive credit for this assignment:

Extra Challenges (Not Required)

Last Updated 08/26/2024