Number of registrants Fee per person
1 through 4 R100.00
5 through 10 R 80.00
11 or more R 60.00
Complete the program below.
#include <iostream> using namespace std; int main()
{
// Question 4.1 (2)
// Declare a variable to hold the number of registrants and a
// variable to hold the amount a company owes for a seminar
#include<iostream>
using namespace std;
int main()
{
int reg;
double sumForSem=0;
cout << "Please, enter a number of registrants: ";
cin >> reg;
if (reg >= 1 && reg <= 4)
{
sumForSem = 100 * reg;
}
else if (reg >= 5 && reg <= 10)
{
sumForSem = 80 * reg;
}
else if (reg >= 11)
{
sumForSem = 60 * reg;
}
cout << "A company owes for a seminar R " << sumForSem;
}
Comments
Leave a comment