Cin And Cout Project

Write the appropriate C++ statements to march the description in the following comments:

// declare two integer variables feet and inches


// ask the user how many feet and inches tall they are(no fraction)


//input the feet and inches


//assign inches, the value of inches plus feet times 12


// output with appropriate message the number of inches the person is tall.

 

 

 

Real Estate Project
Imagine you are a real estate agent and make your living from the sales commissions. House commission paid to sell a house through multiple listings are 6%. The listing agency receives 3% and selling agency receives 3%. Of that 3%, each agency gets 1.5% and the selling agent or listing agent gets 1.5%. As a real estate agent, you want to know how much you will receive for a house that you either list or sell. For your record, identify the house by the owners's last name. Write a program that ask the user for the name and selling price of the home. Calculate the amount paid by the homeowner to sell the home and the amount of the commission you will receive. Use constant for the commission rate (const dataType variableName = value;). Be sure to include all preprocessor directions that you need. Your program should include appropriate comments. Drop your project in my digital drop box. Have fun. See you on Tuesday.

 

getAndIgnoreProject
Write a complete C++ program that asks the user to enter a first name, middle name or initial, and last name separated by blanks. Output the user’s initials. Use the cin.get() function and the cin.ignore() function to first read a character of each string and then disregard the rest of the string. After executing your program, select and copy everything that appears on your screen. Copy and paste text into a comment block at the end of your program. Save your program as getAndIgnoreProject.cpp and put it in my digital drop box.
Program execution should look something like the following example:
The prompt and user input should resemble the following:
Enter your first name, middle name or initial, and last name separated by blanks
John man Doe
The output should be similar to the following:
Your initials are JMD
You may use the following program design:
//program comments
//use the correct preprocessor directive for input/output
//open the main function with the correct heading
//declare three variables to read in the first character of each string
//ask the user to enter his/her first name, middle name or initial, and last name, each
//separated by a blank
//read in the first character of the first name
//ignore the characters of the first name until a blank is encountered
//read in the first character of the middle name or initial
//ignore the characters of the middle name or initial until a blank is encountered
//read in the first character of the last name
//ignore the characters of the last name until a newline is encountered
//display a message with the three initials
//write the return statement
//close the main function

Modify ItemRemove Item
Item Tracking
 

 

 

usingGetlineFunction
Write a complete C++ program that ask the user to enter his or her name, street address, and city, state, and zip code into three strings variables. Then print out the strings as you would to address an envelope. After executing your program, select and copy everything that appears on your screen. Copy and paste text into a comment block at the end of your program. Save the program as getlineProject.cpp, then put the completed program and output in my digital drop box.
You may use the following program design:
//program comments
//use the correct preprocessor directive for input/output
//open the main function with the correct heading
//declare three variables to read in the name, the entire street address, and the combined city, state, and zip.
//ask the user to enter his/her complete name
//use the getline() function to read in the name
//ask the user for his/her complete street address
//use the getline() function to read in the street address
//ask the user for his/her complete city, state, and zip code
//use the getline() function to read in the city, state, and zip code into 1 string
//display on 3 lines the name, street address, city, state, and zip
//write the return statement
//close the main function

 

 

Using Input Output File
Suppose you are ordering merchandise for a small gift shop. The wholesaler requires that you send your order as a file over a modem. Create your order file by entering from the keyboard and writing to an output file. The order information consist of the number of items, the wholesale cost, and the description per line or record. Create an output file named order.out. When writing this file, separate each entry with a blank and use an endl after each description. Output files do not have column headings. Those are only shown for clarity in the assignment. After executing your program, select and copy everything that appears on your screen. Copy and paste text into a comment block at the end of your program. Save the program as FileProject.cpp, then put the completed program and output in my digital drop box.
Create a file with the following information:
Number of items Wholesale Cost Description
5 4.49 Pencil Sharpener
2 12.00 Designer folder

Program execution should look something like the following example.

The prompt and user input from keyboard should resemble:

Enter your first data item by quantity, cost, description separated by a blank
5 4.49 Pencil sharpener
Enter your second data item by quantity, cost, description separated by a blank
2 12.00 Designer folder

There is no screen output. The order.out file should resemble:
5 4.49 Pencil sharpener
2 12.00 Designer folder

You may use the following program design:
//program comments
//use the correct preprocessor directive for input/output
//open the main function with the correct heading
//declare 4 variables to read in the quantity, cost, and description, and a file variable for output
//open the output file
//prompt the user to enter quantity, cost and description separated by a blank
//use cin to input quantity and cost
//use the getline() function to input the description
//write to your output file quantity, a blank, cost, a blank, description, and endl

 

Police Radar Gun
Write a program to stimulate a police radar gun. The program should read an automobile speed and display the message “warning” if the speed exceeds the posted limit by less than 10 miles. If the automobile exceeds the speed limit by 10 miles per hour or more, the message “ticket” is displayed. If the automobile is within the speed range, nothing is displayed.

 

Planet
Write a program that determines your weight on another planet. The program should ask for the user’s weight on Earth, then present a menu of the other planets in our solar system. The user should choose one of the planets from the menu and use a switch statement to calculate the weight on the chosen planet. Use the following conversion factors for the other planets

 
Planet           Multiply by
Mercury          0.37
Venus             0.88
Mars               0.38
Jupiter            2.64
Saturn            1.15
Uranus            1.15
Neptune          1.12
Pluto              0.04

Modify your program to allow the user to repeatedly choose another until he/she do not want to choose again. That means add an exit to your menu. Save your program as Planets.cpp

Modify ItemRemove Item
 

 Integer Problem
Write a program that asks the user for a series of integers one at a time. When the user enters the integer 0, the program displays the following information:
1)The number of integers in the series (not including zero)
2) The average of the integers
3) The largest integer in the series
4) The smallest integer in the series
5) The difference between the largest and the smallest integer in the series

 

Hospital Billing
A Community Hospital needs a program to compute and print a statement for each patient. Charges for each day are as follows:
a. Room charges: private room, $125.00; semiprivate room, $95.00; ward, $70.25
b. Telephone charge: $1.75
c. Television charge: $3.50
Write a program to get a line of data from the keyboard, compute the patient’s bill, and print an appropriate statement. Typical input is

5PNY
where 5 indicates the number of days spent in the hospital, P represents the room type(P, S, or W), N represents the telephone option(Y or N), and Y represents the television option(Y or N). A statement for the data given follows:

Community Hospital
Patient Billing Statement
Number of day in hospital: 5 Type of room:
Private Room charge $625.00
Telephone charge $ 0.00
Television charge $ 17.50
Total Due $642.50

Taxes
The personal income tax tables for the state of New Jersey in 2000 were printed on the income tax form as follows.
If the net taxable income is
Over but not over The tax is
-0- to $2,000 3% of the taxable income
$2,000 to $4,000 $60 + 4% of the amount over $2,000
$4000 to $6000 $140 + 5% of the amount over $4,000
$6,000 to $10,000 $240 + 6% of the amount over $6,000
$10,000 $480 + 7% of the amount over $10,000

Write a program that can compute the income tax liability based on the information above

 

 

NestedLoop
Using Nested forLoop Write a program that prints five spreadsheet-style column titles with the values A, B, C D, and E, and five row titles with the values 1, 2, 3, 4, 5. Use a for loop to output the column headings. Use nested for loops to output the row number and the values within the rows and columns. The output should look like the following

 
     A    B    C   D   E
1    1    2    3   4   5
2    1    2    3   4   5
3    1    2    3   4   5
4    1    2    3   4   5
5    1    2    3   4   5

Modify ItemRemove Item
 

 

OneDArrayProject

 

Write a program that asks users for five numbers.  
Put these numbers in an array, then, find the sum and average of these numbers.  
Your output should include the numbers, their sum and the average.
 

TwoDArrayProject


Write a program to create a rectangular array containing a multiplication table from 1 x 1 up to 12 x 12. Output the table as 13 columns with the numeric values right aligned in columns (The first line of output will be the column headings, the first column with no heading, then the number 1 to 12 for the remaining columns. The first item in each of the succeeding lines is the row heading which ranges from 1 to 12.)