a. Write a pseudo-code that prompt the user to input number of sold items and then receive the sold value for each item, calculate the average value, display the items numbers associated with its values and display also the calculated average value on the screen.
b. write down the C++ code for the previous program.
Well... I tried to solve it and here we go:
* Pseudo-code:
start
get sold items,sold value
average=sold value/sold items
Display sold items,sold value
Display average
* C++:
#include<iostream.h>
void main()
{
int NumOfSold,SolValue;
float average;
cout<<"enter the number of sold items\n";
cin>>NumOfSold;
cout<<"enter the sold value for each item\n";
cin>>SolValue;
average=(float)SolValue/NumOfSold;
cout<<NumOfSold<<":"<<SolValue<<endl;
cout<<"average:"<<average;
}
I'm 100% sure that the program above is incorrect and need some modifications..
plzzzzz...put me on the right direction. Thnx