387,610 views
24 votes
24 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)

User Mkleint
by
2.6k points

1 Answer

21 votes
21 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 Serge Wautier
by
2.9k points