Question: For this homework assignment create a single Microsoft Word document which contains the C++ source code for each problem, screen captures showing representative output. Then
For this homework assignment create a single Microsoft Word document which contains the C++ source code for each problem, screen captures showing representative output. Then upload the Word document to Canvas. It is acceptable to upload the txt files generated by problems 1, 2 and 4 as separate files if you like.
1.0 Using the temps.txt data file (Located on the Data Canvas Page) which has temperatures in degrees Celsius create a new data file that consists of a table of temperatures in Celsius, Fahrenheit and Kelvin. The equation to convert Celsius to Fahrenheit is:
F = 9/5 * Celsius + 32
To convert Celsius to Kelvin add 273 degrees.
The table should have headings for each temperature as shown below.
Celsius Fahrenheit Kelvin
32.0 0 305
100 212 405
2.0 Write a program that will prompt the user to enter a list of book titles, authors and prices and then create a new file with the information provided. You can use online resources to get book information if you like. The information should be formatted as follows:
Title left justified in a 40 space field
Author last name and initial left justified in a 20 space field
Price right justified in a 7 space field with 2 digits of precision
Fill the intermediate space between values with dots instead of spaces.
Example:
Flash Boys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Lewis M. . . . . . . . . . . . . $24.95
Endless Forms Most Beautiful . . . . . . . . . . . . . .Carroll S. . . . . . . . . . . . . $17.95
Create a file with at least 10 entries.
3.0 Write a program that will prompt the user to enter a sentence and then perform the following operations.
Print the number of characters in the sentence to the screen.
Count the number of words in the sentence.
Print the sentence to the screen in all uppercase. (Research how to do this.)
Prompt the user to enter a position within the string and the number of characters wanted. Then print the substring specified by those values. NOTE: Make sure that the position and number of characters fall within the string before performing the operation.
Prompt the user to enter a single character and then print out the position within the sentence where every occurrence of that character appears.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
