Q3. Write a pesudocode to read 3 product names, their prices and calculate their
ID: 3542439 • Letter: Q
Question
Q3. Write a pesudocode to read 3 product names, their prices and calculate their subtotal, amount of tax and total. Show all the results
Q4. Write the same puseducode in Q3 in Java programming
Q5. Write a pesudocode that will read 10 values in a loop and find the sum of only these numbers that are divisible by 4.
Q6. Write a program in the java to read three tests and two projects. If the tests count as 60% of the total grade and the projects counts as the remaining 40%, calculate the average of the scores. Also print the letter grade corresponding to the final score based on classical scale (90-100, A, etc). Make sure the average is not less than zero or greater than 100.
Explanation / Answer
#include<iostream>
using namespace std;
struct product
{
char name[20];
int price;
}p[3];
int main()
{int i,tax,total;
cout<<"enter the product names: "<<endl;
for(i=0;i<3;i++)
{cin>>p[i].name;
}
cout<<"enter the product prices: "<<endl;
for(i=0;i<3;i++)
{cin>>p[i].price;
}
total=p[0].price+p[1].price+p[2].price;
cout<<"total price is :"<<total<<endl;
cout<<"enter the tax percent :";
cin>>tax;
cout<<endl;
cout<<"total tax is : "<<total*tax/100;
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.