ict209-283-Test2 - Test yourself by writing the answers out by hand pen Your name Full-time study Part-time study(delete one All questions are long

ict209-283-Test2 - Test yourself by writing the answers out...

This preview shows page 1 - 2 out of 3 pages.

1 Test yourself by writing the answers out by hand - pen Your name: Full-time study Part-time study (delete one) All questions are long answer questions. When writing code to solve a given problem or code a data structure, you must also provide a test-plan, a test program and unit tests for data structures or classes. 1. Write a program that prompts the user to input the elapsed time for an event in hours, minutes, and seconds. The program then outputs the elapsed time in seconds. What test data would you use to make sure that your program works. You need to provide reasons for selecting the test data. 2. The manager of a football stadium wants you to write a program that calculates the total ticket sales after each game. There are four types of tickets with each type having its own price. After each game, data is stored in a data file called sales.txt . The data file format is as shown below: Ticket price numberOfTicketsSold ..... Sample data is shown below. You must not assume that this will be the data after every game. There is only data and no column headers. Data items on the same line are separated by white space. 250 5750 100 28000 50 3570 25 18750 The first line indicates that the ticket price is $250 and that 5750 tickets were sold at that price. Your program outputs the number of tickets sold and the total sale amount.
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read all 3 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes