#include using namespace std; int main(){ const int NO_EMP = 5; double salary [NO_EMP]; double highest -0; double sum = 0; // COMPLETE YOUR CODE HERE return 0; Complete the C++ program by prompting a user for 5 employee's salary and store into an array salary. Then display the total of salary as well as the highest salary among the employee. Correct your display to 2 decimal places. [4 marks]

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section: Chapter Questions
Problem 7PP
icon
Related questions
Question

Hi

 

Given the C++ statements as in the pic

#include <iostream>
using namespace std;
int main() {
const int NO_EMP = 5;
double salary [NO_EMP];
double highest -0;
double sum = 0;
// COMPLETE YOUR CODE HERE
return 0;
Complete the C++ program by prompting a user for 5 employee's salary and store into an array
salary. Then display the total of salary as well as the highest salary among the employee. Correct
your display to 2 decimal places.
[4 marks)
Sample Output
Enter salary employee #1 : 2300.50
Enter salary employee #2 : 3700.00
Enter salary employee #3 : 4820.70
Enter salary employee #4 : 1800.00
Enter salary employee #5 : 2330.60
The sum is : RM 14951.80
The highest salary is RM 4820.70
Transcribed Image Text:#include <iostream> using namespace std; int main() { const int NO_EMP = 5; double salary [NO_EMP]; double highest -0; double sum = 0; // COMPLETE YOUR CODE HERE return 0; Complete the C++ program by prompting a user for 5 employee's salary and store into an array salary. Then display the total of salary as well as the highest salary among the employee. Correct your display to 2 decimal places. [4 marks) Sample Output Enter salary employee #1 : 2300.50 Enter salary employee #2 : 3700.00 Enter salary employee #3 : 4820.70 Enter salary employee #4 : 1800.00 Enter salary employee #5 : 2330.60 The sum is : RM 14951.80 The highest salary is RM 4820.70
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Declaring and Defining the Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT