must compile part 1 write a program which reads an integer, n, and print a patte
ID: 3635736 • Letter: M
Question
must compilepart 1
write a program which reads an integer, n, and print a pattern of *'s which form an increasing triangle followed by a decreasing triangle. If n equals 5 the pattern should look like this
*
**
***
****
*****
****
***
**
*
part 2
must compile
ou are to write a program which reads a disk file named "salary.txt" and prints a report on salary for a set of people defined in the file. The file should have each person's first name, last name and salary. The file would look like
name1 10000
name2 8000
name3 6000
name4 4000
A loop which reads the data can be written using
while ( input_stream >> first_name >> last_name >> salary ) {
....
}
where input_stream is the ifstream variable for the file.
enter your own names and salaries.
Each employee would pay 15% income tax and $750 for health insurance each month. This would mean that the report should look like
Employee Salary Income Tax Health Net Pay
------------------- -------- ---------- ------ --------
name1 10000.00 1500.00 750.00 7750.00
name2 Einstein 8000.00 1200.00 750.00 6050.00
name3 6000.00 750.00 750.00 4500.00
name4 4000.00. 600.00 750.00 2650.00
To print a name like "rich bates" as 1 field, set a variable for the full name using
full_name = first_name + " " + last_name;
Explanation / Answer
Hi, part1 #include #include using namespace std; int main() { for (int r=1; rRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.