1 / 4

LAB SESSION

LAB SESSION. ONE DIMENSIONAL ARRAY. Question 1 (edited FROM csc 128 march 2012 exam paper).

kisha
Download Presentation

LAB SESSION

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LAB SESSION ONE DIMENSIONAL ARRAY

  2. Question 1(edited FROM csc 128 march 2012 exam paper) • Compass is currently holding a charity car wash for a week. You are asked to write a program that calculates and displays the total collection, the average collection, and the minimum and maximum collection for the week. • Thus, create an array of floating point of size SEVEN (7) to store the total collection per day from Monday through Sunday. • Sample input and output as below:

  3. QUESTION 2(taken FROM csc 128 okt2012 exam paper)

  4. Question 3(taken FROM csc 128 sept 2011 exam paper) • Write a program that accepts any number of integers from the user in the range of 1 • to 50 only. Only numbers in the range 1 to 50 should be stored in an array. The • maximum size of the array is 100. Calculate the sum of the integers in the array and • display the result. Assume the input ends when -1 is encountered.

More Related