Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ Problem Description: Swim Level Lifetime fitness has an aqua program for chi

ID: 3694084 • Letter: C

Question

C++

Problem Description: Swim Level

Lifetime fitness has an aqua program for children to attend swimming school. They have the following levels

: Level 1: Intro to Splash teaches 8 skills

Level 101: Splash/Ripple teaches 9 skills

Level 201: Splash/Ripple/Wave teaches 8 skills

Level 301: Ripple/Wave/Surf I teaches 6 skills

Level 401: Ripple/Wave/Surf II teaches 7 skills

Level 501: Wave/Surf I teaches 7 skills

Level 601: Wave/Surf II teaches 7 skills

The next skill develops from the previous skill.

•Suppose they want to have a program that asks the teacher for the name of the student, and the highest level the student is at. The program would then display the total number of skills a student has based on the student's highest skill level.

The program must have constants to define each swim level (1, 101, 102, etc.)

The program must keep track of the student name and the highest swim level

Your program logic must calculate the total number of skill sets inside a loop. For example, if the skill level = 101, then the total will start at 0, then 9 would be added for level 101 and then the 8 would be added in for level 1. If the highest skill level = 201, then the total will start at 0, then 8 would be added for level 201, then 9 would be added for level 101 and then the 8 would be added for level 1 would get added.

The sentinel (or stopping condition of your loop) must be when the skill level goes below 0.

If the user enters a skill level value that is not 1, 101, 201, 301, 401, 501, or 601 - your program should display an error message and prompt the user for the skill level again until the user enters a valid skill level.

Explanation / Answer

#include <iostream>
#include<stdio.h>
#include<stdlib.h>
using namespace std;

int main() {
   int slevel,i,a[7]={8,9,8,6,7,7,7},j,total=0;
   char str[75];
   cout<<"Enter the name and skill level of the student respectively ";
   cin>>str>>slevel;
   while(slevel==1||slevel==101||slevel==201||slevel==301||slevel==401||slevel==501||slevel==601)
   {
   if(slevel==1)
   i=0;
   else if(slevel==101)
   i=1;
   else if(slevel==201)
   i=2;
   else if(slevel==301)
   i=3;
   else if(slevel==401)
   i=4;
   else if(slevel==501)
   i=5;
   else if(slevel==601)
   i=6;
   for(j=i;j>=0;j--)
   {
       total=total+a[j];
   }
   cout<<"Total number of skills is "<<total;
   cout<<"Enter the name and skill level of the student respectively ";
   cin>>str>>slevel;
   if(slevel!=1||slevel!=101||slevel!=201||slevel!=301||slevel!=401||slevel!=501||slevel!=601)
   {
       cout<<"The entered skill level doesnt exist ";
       cout<<"Enter the name and skill level of the student respectively ";
   cin>>str>>slevel;
   }
   }
   return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote