increments or original price. The program should display the seven diSOOU prices
ID: 3595015 • Letter: I
Question
increments or original price. The program should display the seven diSOOU prices. If necessary, create a new project named Intermediate21 Proj it in the Cpp8IChap07 folder. Enter your Ct+ instructions into a source file na Intermediate21.cpp. Also enter appropriate comments and any additional instrn required by the compiler. Save, run, and test the program. Baxter Skating Rink holds a weekly ice-skating competition. Competing skaters must ucti 22. per- form a two-minute program in front of a panel of judges.The number of judges varies from week to week. At the end of a skater's program, each judge assigns a score of 0 through 10 to the skater. Create a program that allows the rink manager to enter each judge's score for a specific skater. The program should display the number of scores entered, the skater's total score, and the skater's average score. If necessary, create a new project named Intermediate22 Project, and save it in the Cpp81Chap07 folder. Enter the C++ instructions additional instructions required by the compiler. Save, run, and test the program file named Intermediate22.cpp. Also enter appropriate comments and any Create a program that allows the user to enter the gender (either F or M) and GPA (0.0 through 4.0) for any number of students. The program should calculate and display 23. the average GPA for all students, the average GPA for male students, and the average GPA for female students. If necessary, create a new project named Intermediate23 Project, and save it in the Cpp81Chap07 folder. Enter the C++ instructions into a source file named Intermediate23.cpp. Also enter appropriate comments and any additional instructions required by the compiler. Save, run, and test the program Create a program that displays the ending balance in a savings account, given the begin- itomounts ond the swithdrawal amounts I Ise to 1Explanation / Answer
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;//total number of students
int male=0;//number of male students
int female=0;//number of female students
double male_sum=0;//total sum of GPA of male students
double female_sum=0;//total sum of GPA of female students
char ch;//For storing Gender
double gpa;
cout<<"Welcome ";
cout<<"Enter number of Students ";
cin>>n;
for(int i=0;i<n;i++)
{
cout<<"Enter Gender (M/F) ";
cin>>ch;
cout<<"Enter GPA(0.0 through 4.0) ";
cin>>gpa;
if(ch=='M')
{
male_sum=male_sum+gpa;
male++;
}
else if(ch=='F')
{
female_sum=female_sum+gpa;
female++;
}
}
cout<<"Average GPA for All Students : "<<(male_sum+female_sum)/(double)n<<' ';
cout<<"Average GPA for Male Students : "<<(male_sum/(double)male)<<' ';
cout<<"Average GPA for Female Students : "<<(female_sum/(double)female)<<' ';
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.