*Hello, i'm relatively new to Structured Programming C++ and my teacher is throwing us into the deep end with this lab. I only have an understanding of the basics, so i'm not doing well in understanding this lab. I've defined a few things that I think i'll need in my program, but that's it. If you could help, it'd be much appreciated. Thank you.*
Lab: You are to develop a program that will determine what time zone random samplings of residents live. The 4 choices of course are Eastern (E), Central (C), Mountain (M), and Pacific (P) Time zones.
The report you produce will show the total number of residents in each time zone, and the associated %age.
You will need to determine the best looping mechanism to handle ANY amount of input.
You design the output report. Make it professional looking and formatted.
Be sure to show %ages with 2 decimals.
Be sure to turn in source code and output. Test your program appropriately. (E.g. what if no one lived in one or more of the time zones).
Lastly, write this program 2 ways – one with CASE and one way with IF/Else flow of control. Tell me which way you prefer, and why?
*Below is what I have so far.*
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
// Assignment 4: Part 1: U.S. Residency Report
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
int E; //Eastern Time Zone
int C; //Central Time Zone
int M; //Mountain Time Zone
int P; //Pacific Time Zone
double residents;
double age;
double total_residents; //Total number of residents in each time zone
double percent_age; //Associated percent age
cout << "\n\n\n\n\n\n\n\n\n";
cout << right << setw(45) << "Enter a random number of residents: ";
cin >> residents;