0% found this document useful (0 votes)
11 views4 pages

Abacus Notes 1 6

The document outlines two programming tasks involving arrays: one for managing a contact list with names and telephone numbers, and another for tracking football teams' performance in a league. The first task requires user input for contacts, including validation for duplicates and functionality for finding and exchanging numbers. The second task involves inputting team names and their game results, ensuring data integrity against the total number of games played.

Uploaded by

HASIB MD TURJO
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)
11 views4 pages

Abacus Notes 1 6

The document outlines two programming tasks involving arrays: one for managing a contact list with names and telephone numbers, and another for tracking football teams' performance in a league. The first task requires user input for contacts, including validation for duplicates and functionality for finding and exchanging numbers. The second task involves inputting team names and their game results, ensuring data integrity against the total number of games played.

Uploaded by

HASIB MD TURJO
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
You are on page 1/ 4

1 A two-dimensional (2D) array Contacts[] is used to store names and telephone numbers.

All
the data is stored as strings. The array must have the capacity to store 100 contacts in the form of:
• column 1 – contact names as: last name, first name
for example: Smith, John
• column 2 – telephone numbers.

The variable CurrentSize shows how many contacts are in the array.

Write a program that meets the following requirements:

• Fill up the Contacts array by user input. If user gives same input for contact name and
telephone number, reject that input and ask again.
• Ask user for a name, find the corresponding telephone number to that name and replace it
with a 0.
• Ask user for two names, then find the two names and exchange their telephone numbers.
• Ask user for 4 names. Out of 4, output to the user how many you found. It could be 0/1/2/3/4.

You must use pseudocode or program code and add comments to explain how your code works.

You do not need to declare any arrays, variables or constants; you may assume that this has
already been done.

All inputs and outputs must contain suitable messages.

You do not need to initialise the data in the array Contacts[] and the variable CurrentSize

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
2 A one-dimensional (1D) array Teams[] contains the names of 10 football teams in a local league.
A two-dimensional (2D) array Results[] stores, for each team, the total number of:

• games won
• games drawn
• games lost
• points.

The position of any team’s data is the same in both arrays. For example the data in index 3 of
Results[] belongs to the team in index 3 of Teams[]

The array data will be used to find the current leader of the league.

The variable Played stores the number of games played by each team. Each team plays the
same number of games.

Write a program that meets the following requirements:

• allows the number of games played to be input and stored, with a maximum of 18 games
• allows the names of the teams to be input and stored
• allows the number of games won, drawn and lost to be input and stored for each team
• validates the number of games played and the number of games won, drawn or lost against
the number of games played

You must use pseudocode or program code and add comments to explain how your code works.

You do not need to declare any arrays, variables or constants; you may assume that this has
already been done.

All inputs and outputs must contain suitable messages.

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................
..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

..........................................................................................................................................................

You might also like