Question: c++ with comment Objectives: Become familiar with loops Write C++ programs using for and while (counter control, sentinel control and flag control) and nested loops.

c++ with comment  c++ with comment Objectives: Become familiar with loops Write C++ programs
using for and while (counter control, sentinel control and flag control) and
nested loops. 1/0 files with output formatting manipulators. 1. Count cash: Write
a program that reads the amount of coins collected at the end

Objectives: Become familiar with loops Write C++ programs using for and while (counter control, sentinel control and flag control) and nested loops. 1/0 files with output formatting manipulators. 1. Count cash: Write a program that reads the amount of coins collected at the end of each day of a month in a local supermarket and calculates the total amount in fils (1 AED = 100 fils). The program reads the data for the entire month from the file coins.txt (assume the month has 30 days). The input file has one line for each day where each line has: number of fils, space, number of 5-fils, space, number of 10-fils, space, number of 25-fils, space, and number of 50-fils. Make sure that the total amount is displayed with exactly two decimals. For the sake of testing your program consider an input file where the first 29 lines, each contains 00000 and the last line are 11111. This means the file is for a month where no coins where collected in the first 29 days. The output should be 0.91 AED. Now if you test your program for having 0 0 0 0 0 for the first 28 days and for the last 2 days, we have: 77 117 430 705 520 89 320 414 833 850 Then the answer is shown below: Sample run (with the above file): Total amount collected is: AED 1178.32 execution time: 0.263 s Process returned o (Oxo) Press any key to continue. 2. Data Security Encryption is an effective way to achieve data security. To read an encrypted file, you must have access to a secret key or password that enables you to decrypt it. You are expected to implement a simple encryption/decryption program. The program shall read the text from an input text file character by character (use cin.get() function) and produces an encrypted or decrypted version of the file. Your program shall allow the user to enter either 1 for encryption or 2 for decryption. The encryption procedure is to replace each alphabet by another one and each digit by another digit as follows: character Encrypted character Hint A, B, C, ...X,Y,Z T,U,V..., Q, R, S Compute the shift from 'A' to 'T', 'a' a, b, c, z n, o, p...k. I, m to'n', and 'O' to 's' Use the % operator to rotate. 0, 1, 2, 9 5,6,7,...,3,4 Other characters are not encrypted. The decryption procedure is to reverse the encryption procedure such that you obtain the original text file. Sample run: Enter your option: 1. to Encrypt the file 2. to Decrypt the file Option : : 1 The encryption result of the input file is stored in "enrypted_msg.txt". Process returned @ (exe) execution time : 2.634 s Press any key to continue. Input file: (available on BB) X Sample 1 decrypted_msg.txt -- File Edit Format View Help ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz 0123456789 Sample 2 decrypted_mag txt - Notepad File Edit Format View Help His Highness Dr Shaikh Sultan Bin Mohammad Al Qasimi, Supreme Council Member and Ruler of Sharjah, attended the opening of the International Conference on Solutions for a Better life at the University of Sharjah. The five-day International Conference is being hosted by the University of Sharjah in partnership with West Virginia State University of the United States and the World Health Organisation (WHO). Windo in 1. C 100% Windows (CF In 1. Col1 100% Output file: (encrypted_msg.txt; this is the input for decrypt process) Sample 1 enrypted_msg.txt - N... File Edit Format View Help TUVWXYZABCDEFGHIJKLMNOPQRS nopqrstuvwxyzabcdefghijklm 5678901234 Sample 2 enrypted_msg.txt - Notepad File Edit Format View Help Avf Avtuarff We Lunvxu Lhygna Uva Fbunzzng Ty Infuzv, Lhcerzr Vbhapvy Frzore naq Khyre bs Lunewnu, nggraqrq gur bcravat bs gur Bagreangvbany Vbasrerapr ba Lbyhgvbaf sbe n Urggre Ever ng gur Navirefvgl bs Lunewnu.Mur svir-nl Bagreangvbany Vbasrerapr vf orvat ubfgrq ol gur Navirefugl bs Lunewnu va cnegarefuvc jvgu Prfg Ovetvavn Lgngr Navirefugl bs gur Navgrq Lgngrf naq gur Pbeyq Arnygu Hetnavfngvba (PAH). Windo In 1.C 100% Windows (CF Ln 1. Col 1 100%

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!