Due to upcoming end of financial year, you are being called in to write a program which will read in an input file called IncomeRec.txt, whichcontains a list of Annual(Gross)incomerecordsof employees in a firm,and produce various reports as outlined
Milk is sold out on a daily basis with a rate of RM4.50/Liter. The relationship between weight w (Kg) and milk production m (Liter) is given by: 𝑚 = (𝐴𝑤0.54 + 𝐵) × 𝐶 where A, B and C are the coefficients (variables). The coefficients A is 1.15 and B is 0.25. Meanwhile, for coefficient C, the rate is depending on the weight of the cow where C will be 0.2 when the weight is below 600kg and will be 0.5 when the weight of the cow is equal and above 600kg. The weight of each animal is listed in Table 1. Table 1 Cow ID 1 2 3 4 5 Weight (Kg) 500 625 718 813 995 As a programmer, you are required to help the farm owner, by writing a C program to compute the daily sell value (in RM) of milk. Any suitable control statement should be applied in your program. The sample of output is given in Figure 1.
Enter weight 1) - 500 Enter weight 2) - 625 Enter weight 3) - 718 Enter weight 4) - 813 Enter weight 5) - 995 Total milk produce in Liter = 91.12 Sell value of milk = RM410.06
The input file called IncomeRec.txt contains a list of Annual (Gross) income records of employees in a firm. You will assume that this firm contains at most 200 active staff. Each record is on a single line and the fields are separated by a single space. The names of the fields are: • Employee Lastname (initial) - char • FNPF# - integer • Age - integer • Gross_Income - integer • Resident - char An example record may have the following form: F 12345 24 40000 Y And the format of the actual file is shown below. (Note: This doesn’t show all records and for clarity, fields here are shown separated by tabs, but in the actual file they are separated by single spaces) Note: ▪ The first two lines are just header lines and can be discarded ▪ Lastname contains an initial, an alphabetical letter only; ▪ FNPF# contains a 5 digit number; ▪ Gross income contains a 3-7 digit number; ▪ Resident contains a ‘Y’ or ‘N’, representing resident or non-resident respectively
Loop to ask user to 30 integer
void student(string s ,ifstream &in)
{
// read each line and compare the name s
}
int main()
{
string s; cin>>s; // input string
ifstream in;
in.open("Text1.txt");
student(s, in);
system("pause");
return 0;
}
write a program that reads input file called IncomeRec.txt, The input file contains a list of Annual (Gross) income records of employees with at most 200 staff. Each record is on a single line and the fields are separated by a single space. The names of the fields are: • Employee Lastname (initial) char
• FNPF# - integer
• Age - integer
• Gross_Income - integer
• Resident - char
Requirements
1. Print the entire list. by typing 1 and should print the contents of the file on the screen. (fileds output are: lastname initial, FNPF#, age, Gross_Income and Resident)
2. Print list sorted by Gross Income by typing 2. Program prints the list in ascending order of Gross Income. ( fields output are: FNPF# and Gross_Income)
3. Print list of employees which match a given lastname initial typing 3. the user is asked to enter the search initial. if no person have last names matching the search initial “no matching record found” is displayed. to display in output are: lastname and FNPF#
Write a c++ program that reads in 10 midday temperatures for Port Elizabeth, for 10 consecutive days. Only temperatures higher than 0 and less than 45 are valid (working with integer values for temperatures). It must calculate and display the following: The warmest temperature The average temperature. The number of days that the temperature was higher than 30.
Print a random number Between 1 and 75 inclusive