49.6k views
3 votes
Admission to attend a show are as follows:

Adults: $20
Children:$15

Write a program that reads the number of children attending the show, as well as the number of adults. Calculate and print the total revenue made.(Pascal)

1 Answer

4 votes

Answer:

#include <bits/stdc++. h>

using namespace std;

int main(){



int AdultPrice = 20;

int ChildrenPrice = 15;

int numChildren, numAdults;

cin >>numChildren >> numAdults;

int revChildren = numChildren*ChildrenPrice;

int revAdult = numAdults*AdultPrice;

cout << revChildren+revAdult << endl;

return 0;

}

User Ivan Kishchenko
by
3.5k points