Question: Programming Assignment 1 Due Tuesday January 28th Please solve the following problems completely. You must provide a hard copy of the programs and their outputs
Programming Assignment 1 Due Tuesday January 28th
Please solve the following problems completely. You must provide a hard copy of the programs and their outputs.
- 30 points Write a C++ program that computes student grades for an assignment as a percentage given each students score and the total points. The final score should be rounded up to the nearest whole value using the celi function in the header file. You should also display the floating-point result up to 5 decimal places. You should have a function to print the last name of the student and another function to compute and print the percentage as well as Excellent if the grade is greater than 90, Well Done if the grade is greater than 80, Good if the grade is greater than 70, Need improvement if the greater than or equal to 60, and Fail if the grade is less than 50. The main function is responsible for reading the input file and passing the appropriate arguments to your functions. Here is an example of what the input file might look like:
Weems 50 60
Dale 51 60
Richards 57 60
Smith 36 60
Tomlin 44 60
Bird 45 60
-
The output of your program should look like:
Weems 83% .83333 Well Done
Dale 85% .85000 Well Done
Richards 95% .95000 Excellent
Smith 60% .60000 Need Improvement
Tomlin 73% .73333 Good
Bird 75% .75000 Good
-
- 30 points ROT13 (rotate by 13 places) is a simple letter substitution cipher that is an instance of Caesar cipher developed in ancient Rome and used by Julius Caesar who used it in his private correspondence. ROT13 replaces a letter with the letter 13 letters after it in the alphabet. The following table demonstrates the translation in ROT13:
A N
B O
C P
D Q
E R
F S
G T
H U
I V
J W
K X
L Y
M Z
Thus, the translation of the word JULIUS using ROT13 would be WHYVHF. Write a C++ program that asks the user for the name of an input file and translate the contents of that input file using ROT13. Your main function should be responsible for reading the input file and coordinating calls to a function named Rot13 that will do the translation for each character and WriteTranslatedChar that will write the translated character to a secondary file. The Rot13 function should be defined with a reference parameter that will be the initial character as input and translated character as output. The second function named WriteTranslatedChar will have two parameters, the translated character and a reference to an ifstream data type for a secondary file named "output.rot13", and write that translated character to this file.
- 40 points In mathematics, the Fibonacci numbers are the series of number that exhibit the following pattern:
0,1,1,2,3,5,8,13,21,34,55,89,144,....
In mathematical notation the sequence Fn of Fibonacci number is defined by the following recurrence relation:
Fn=Fn-1+Fn-2
With the initial values of F0=0 and F1=1. Thus, the next number in the series is the sum of the previous two numbers. Write a program that asks the user for a positive integer N and generate the Nth Fibonacci number. Your main function should handle user input and pass that data to a function called Fib that takes n integer value N as input and a reference parameter that is assigned the Nth Fibonacci number.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
