Csec Information Technology: Problem-Solving and Program Design

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

CSEC INFORMATION TECHNOLOGY:

PROBLEM-SOLVING AND PROGRAM DESIGN


WORKSHEET #9
ARRAYS : MANIPULATING and SEARCHING
MANIPULATING
1.
Write a program to accept the test scores of 10 students in the array TEST[ ]. Display
the array after all scores have been entered.
2.

Write a program to accept the price of 4 items in the array ITEM[ ]. Calculate a 10%
discount for each item and display the discounted prices.

3.

Write a program to accept two values and determine the larger of the two. Store the
larger number in the array LARGE[ ]. Do this 5 times, then display all 5 larger values.

4.

Write a program to accept the weight of 10 produce items being bought at a market
in the array PRODUCE[ ]. When a weight bigger than 75kg is entered, it should
prompt the vendor to give the customer brawta.

5.

A technician charges fees based on the hours she works:


i. Two hours or less - $290.00 per hour
ii. More than two hours - $265.00 per hour
Write a program to input the hours worked for 5 jobs in an array JOBS[ ]. The program
should output the total hours worked and the five fees charged.

6.

A credit union pays 4% interest on shares and requires that all members make a $500
deposit besides the share amount. Write a program that prompts the user to input 6
share values to the array SHARES[ ]. Calculate the total savings as shares + $500
deposit + interest on shares. And store them in SAVINGS[ ]. Output the 6 total savings
from SAVINGS[ ] after all values have been calculated.

SEARCHING
7.
Write a program that requests that the user input a set of 6 positive numbers which
are stored in the array
N[ ]. Search for those values entered as less than 2,000, and reduce those by 20.
Display all 6 numbers.
8.

Write a program for meteorologists to use during the course of a week. In that time, it
should ask for the temperature at the start of the day and store those numbers in
DAYSTART[ ] and do likewise for the end of the day DAYEND[ ]. Calculate the
differences between the starting temperatures and the ending temperatures for each
day. Identify those differences greater than 10 o

9.

Adjust the program from # 6 to identify those savings that are greater than or equal
to $1500.

You might also like