For completion of the program, use arrays and files.Instead of prompting the user for the prices of the book, update the program to reflect the following changes:Read the prices into an array from a f
Memo
To: | |
From: | |
Class: | PRG211 |
Date: | |
Re: | Individual Assignment for Week 5 |
Pseudo code for the program
Declare integer totalCardNumb
Declare integer C1
Declare Integer Card_Numb[5]
Declare Boolean CardValid
Declare integer PCard
Set
CardValid = False
SetTotalCardNumber = 5
// for loop is used to store the card numbers in an array
For C = 0totalCardNumb -1
Display “Type in your card Number:”
Input Card_Numb[C]
End For
Set C1 = 0
Display “Please type in the Credit Card Number:”
//Checking if the condition is satisfied
If (CardValid ==1)
Then Display “The Card Number is Valid”
Else if (CardValid == 0)
Then Display “The Card Number is Invalid”
End if else
End Program
Flow Chart
Start Program
Declare integer totalCardNumb
Declare integer C
Declare Integer Card_Numb[5]
Declare Boolean CardValid
Declare integer PCard
End Program
The Card Number is Invalid
The Card Number is Valid
CardValid ==1
CardValid==0
Check
If (CardValid ==1)
Set C1 = 0
Display “Please type in the Credit Card Number:”
Display “Type in your card Number:”
Input Card_Numb[C]
For C = 0totalCardNumb -1
Set
CardValid = False
SetTotalCardNumber = 5
0