Question: Source code filename CPP11.CPP Turn in instructions: You will be uploading only the CPP11.CPP file to this myCourses drop box. Be sure to include General
Source code filename CPP11.CPP
Turn in instructions: You will be uploading only the CPP11.CPP file to this myCourses drop box. Be sure to include General Requirements that are outlined in the General Requirements module.
Step 1: Define a series of variables. Use the most efficient data type for the variable according to the Data Types in C++ handout.
Step 2: Create a series of input and output statements to get data from the user (using the keywords we have used in class so far).
Step 3: Ouput the data contained in the variables.
The data will only print out to a limited number of decimal positions, so dont worry if you input .123456789 and it only prints .123457 or some lesser number of positions. Also, output may be transformed to scientific notation by the output statement. This is OK. We will get to formatting output in a future chapter.
//include the header file IOSTREAM use: using namespace std; //define the start of the function main
int main () { //Step 1 (define all variables first) //values come from user input via input statement.do NOT supply values with definition //define a variable appropriate to hold the population of the US 300,000,000+ //define a variable appropriate to hold the average family income in the US 51,321.43 //define a variable appropriate to hold the hourly wage of 1 family member 17.98 //define a variable appropriate to hold the count of the total student attending SPC 30,609 //define a variable appropriate to hold the total GNP of Florida 754,256,198.95 //define a variable appropriate to hold a single character to represent person's gender //Step 2 ( a series of questions getting input from the user, do not type in commas for values as in 123,123.00.it is typed as 123123.00) //Create cout prompts asking the user to input a value for each of the variables 1 cout per variable followed immediately by a cin to hold the user keyboard input value for the variable. You should inform the user not to enter commas! //Step 3 (output all of the data to the screen) //Create couts to put the value of each variable on the screen. If the number of decimal positions is different than you put in or it prints in scientific notation, it is still correct. Make the program beep 5 times using escape sequences. You may only hear one beepthey are spaced too closely together for the human ear to differentiate if your computer has a really fast processor.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
