[go: up one dir, main page]

0% found this document useful (0 votes)
48 views3 pages

Scenario Questions

Uploaded by

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

Scenario Questions

Uploaded by

musheeza liaqat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 3
Aug jal) Baa gl) Anyde Arab Unity School ‘ish Guncuben, Ata 1 the Urwersiy of Cambie A Le, Ip NA GSS2h | Scenario Question#4 wa | Accor) 6? PROGRAMING Ace devaiis C3 Aas yal) baa gl) Au jas Arab Unity School | tan Cem Amine 8 Unvesyo CamDe Scenario Question#7 ‘two-dimensional (20) array Account {) contains account holders’ names and passwords for @ ‘banking program A2D array AccDetai 1s {) has three columns containing the following details: + column one stores the balance the amount of money in the account, for example 250.00 + column two stores the overdraft limit ~ the maximum total amount an account holder can borrow from the bank after the account balance reaches 0,00, for example 100.00 + column three stores the withdrawal imit~ the amount of money that can be withdrawn at one time, for example 200.00 ‘The amount of money in a bank account can be negative (overdrawn) but not by more than the ‘overdraft limit For example, an account with an overdraft limit of 100.00 must have a balance that is greater than ‘or equal to ~100.00 Suitable error messages must be displayed if a withdrawal cannot take place, for example if the overdraft limit or the size of withdrawal is exceeded. ‘The bank account ID gives the index of each account holder’s data held in the two arrays. For example, account ID 20's details would be held in ‘Account [20,1] and Account [20,2] AceDetails{20,1] AccDetails(20, 2) and accDetails (20,3) 1 10 tie ‘The variable Size contains the number of accounts, ic actond PE bank econ Fok ‘The arrays and variable Size have already been set up and the data stored, Write a program that meets the following requirements: «Pecks the account ID exists and the name and password entered by the account holder match the name and password stored in Account [) before any action can take place + displays @ menu showing the four actions available for the account holder to choose from: 1. display balance 2. withdraw money 3. deposit money 4. exit + allows an action to be chosen and completed. Each action is completed by a procedure! ‘with a parameter of the account ID. ‘You must use pseudocode or program code and add comments to explain how your code works | {Al inputs and outputs must contain suitable messages. ‘You only need to declare any local arrays and local variables that you use. You do not need to declare and initiaise the data in the global arrays Account{) and Accbetails{) and the variable 5iz¢ Scenario-6 1D array Members (} contains the name of 80 members ofa running cub, All members ofthe ub Nave taken part in a competition. The distance each member ran in 30 minutes was recorded. A20 47a | Distance} contains the distance. in metres, for each run , for each member. Iwas possible for ‘members to have three attempts at the run but not all members completed three runs. The value 1 Nas been recorded where the member did not complete a un. The position of each member's data hte arrays is the same. For example, the member at position 20 in the array Members {) will have shee rune: recorded at position 20 in the array Meabers [] will have their runs recorded at position in the array Distance] ‘The arrays have already been set up and the data stored. | | Members are allocated categories based on the distance achieved in their best run. Elite ‘Greater than or equal to 7 kilometres ‘Championship | Greater than or equal to 5 kilometres and less than 7 kilometres ‘Club Less than 5 kilometres ‘Write program that meets the following requirements: + Calculates the average distance run for each member. Where a member has completed fewer than three runs, the average will be based only on the number of runs , they completed © Calculates the best distance for each member. © Output. for each member: © mame © number of runs completed. © average distance covered. ©. best distance © category awarded. «Calculates, stores and outputs the total distance ran in the competition. ‘You must pseudocode or programming code. ‘You must add comments to explain how your code works. You do not need to declare or initialise the data in the provided arrays. puie a £7 % 3 SW va compiles rag I 1 al lees pembee DI -& } > dime "eerder in m eee \ { 0 /) 000

You might also like