0% found this document useful (0 votes)
5 views2 pages

Sales Contest Winner Program Tutorial

Uploaded by

shehankonara5
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Sales Contest Winner Program Tutorial

Uploaded by

shehankonara5
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Department of Computer Engineering

Faculty of Engineering, University of Jaffna


EC2010 – Computer Programming
Tutorial 05

Q1.

Write a program that determines the winner of a sales contest would input the number of units
sold by each salesperson and the salesperson who sells the most units win the contest. Assume
10 salespersons participate in the contest and no equal units sold. The input should be in the
following format

<name of the person > <number of units sold >

In the output, you have to display the name of the winner and the number of units sold by him.
Like in the figure below. Use while loop.

(Hint: you can use cin >>variable1 >>variable2 for read the inputs.)

Q2.
Rewrite the program using a do-while loop to input data for 10 salespersons and determine the
winner.
Q3.
Write a program that allows the user to choose from a menu how many salespersons' data to
input (options 1 to 10). Use a switch statement to handle the input number of salespersons. Then
read that many salespersons' data and find the winner. No ties assumed.

You might also like