//Global Constant Global Constant TECH_FEE = 0.05 Module main () //Local Variable Declare Integer studentID, ClassTitles , hoursWorked, numofClass, techFee, totalBill classCost=$150 //Get Student ID Call getStudentID () //Get Class Titles Call getCLassTitles () End Module Module getStudentID () Display "Please enter your Student ID:" Input studentID End Module Module getClassTitles () //Get number of class student wants to add and calculate the total bill Display "One class will be free if you add three classes." Display "How many classes do you want to take? (Limit 3)" Input numofClass if numofClass > 3 then Display "Error: Maximum of 3 Class Allowed" end if while numofClass <= 3 if numofClass == 1 then Display "Please enter the Class Title" Input class1 Set classCost = 150 * numofClass Set techFee = classCost * TECH_FEE Set totalBill = classCost + techFee Else if numofClass == 2 then Display "Please enter the first Class Title:" Input class1 Display "Please enter the second Class Title:" Input class2 Set classCost = 150 * numofClass Set techFee = classCost * TECH_FEE Set totalBill = classCost + techFee Else if numofClass == 3 AND hoursWorked <= 20 then Display "Please enter the first Class Title:" Input class1 Display "Please enter the second Class Title:" Input class2 Display "Please enter the third Class Title:" Input class3 Display "One class will be free as you added three classes!" Set classCost = 150 * (numofClass - 1) Set techFee = classCost * TECH_FEE Set totalBill = classCost + techFee Else if numofClass == 3 AND hoursWorked > 20 then Display "Please make an appointment with the faculty advisor" End if Display "StudentID:" , StudentID Display "Total Class Cost is $" , classCost Display "Total Tech Fee is $" , techFee Display "Total Bill including tech fee is $" , totalBill End while End Module Modify the above pseudocode design to do the following: (FYI: Please modify the existing code only in Pseudocode) - As the student adds courses, load an array named courses[ ] with the course name. - As the student adds courses, load a parallel array named cost[ ] with the cost of that course. - Use the cost[ ] array to calculate the total bill. Be sure that you are not duplicating the totaling logic in you project solution. It should be clean, simple code.
//Global Constant Global Constant TECH_FEE = 0.05 Module main () //Local Variable Declare Integer studentID, ClassTitles , hoursWorked, numofClass, techFee, totalBill classCost=$150 //Get Student ID Call getStudentID () //Get Class Titles Call getCLassTitles () End Module Module getStudentID () Display "Please enter your Student ID:" Input studentID End Module Module getClassTitles () //Get number of class student wants to add and calculate the total bill Display "One class will be free if you add three classes." Display "How many classes do you want to take? (Limit 3)" Input numofClass if numofClass > 3 then Display "Error: Maximum of 3 Class Allowed" end if while numofClass <= 3 if numofClass == 1 then Display "Please enter the Class Title" Input class1 Set classCost = 150 * numofClass Set techFee = classCost * TECH_FEE Set totalBill = classCost + techFee Else if numofClass == 2 then Display "Please enter the first Class Title:" Input class1 Display "Please enter the second Class Title:" Input class2 Set classCost = 150 * numofClass Set techFee = classCost * TECH_FEE Set totalBill = classCost + techFee Else if numofClass == 3 AND hoursWorked <= 20 then Display "Please enter the first Class Title:" Input class1 Display "Please enter the second Class Title:" Input class2 Display "Please enter the third Class Title:" Input class3 Display "One class will be free as you added three classes!" Set classCost = 150 * (numofClass - 1) Set techFee = classCost * TECH_FEE Set totalBill = classCost + techFee Else if numofClass == 3 AND hoursWorked > 20 then Display "Please make an appointment with the faculty advisor" End if Display "StudentID:" , StudentID Display "Total Class Cost is $" , classCost Display "Total Tech Fee is $" , techFee Display "Total Bill including tech fee is $" , totalBill End while End Module Modify the above pseudocode design to do the following: (FYI: Please modify the existing code only in Pseudocode) - As the student adds courses, load an array named courses[ ] with the course name. - As the student adds courses, load a parallel array named cost[ ] with the cost of that course. - Use the cost[ ] array to calculate the total bill. Be sure that you are not duplicating the totaling logic in you project solution. It should be clean, simple code.
Chapter5: Making Decisions
Section: Chapter Questions
Problem 8PE
Related questions
Question
100%
//Global Constant
Global Constant
TECH_FEE = 0.05
Module main ()
//Local Variable
Declare Integer studentID, ClassTitles , hoursWorked, numofClass, techFee, totalBill classCost=$150
//Get Student ID
Call getStudentID ()
//Get Class Titles
Call getCLassTitles ()
End Module
Module getStudentID ()
Display "Please enter your Student ID:"
Input studentID
End Module
Module getClassTitles ()
//Get number of class student wants to add and calculate the total bill
Display "One class will be free if you add three classes."
Display "How many classes do you want to take? (Limit 3)"
Input numofClass
if numofClass > 3 then
Display "Error: Maximum of 3 Class Allowed"
end if
while numofClass <= 3
if numofClass == 1 then
Display "Please enter the Class Title"
Input class1
Set classCost = 150 * numofClass
Set techFee = classCost * TECH_FEE
Set totalBill = classCost + techFee
Else if numofClass == 2 then
Display "Please enter the first Class Title:"
Input class1
Display "Please enter the second Class Title:"
Input class2
Set classCost = 150 * numofClass
Set techFee = classCost * TECH_FEE
Set totalBill = classCost + techFee
Else if numofClass == 3 AND hoursWorked <= 20 then
Display "Please enter the first Class Title:"
Input class1
Display "Please enter the second Class Title:"
Input class2
Display "Please enter the third Class Title:"
Input class3
Display "One class will be free as you added three classes!"
Set classCost = 150 * (numofClass - 1)
Set techFee = classCost * TECH_FEE
Set totalBill = classCost + techFee
Else if numofClass == 3 AND hoursWorked > 20 then
Display "Please make an appointment with the faculty advisor"
End if
Display "StudentID:" , StudentID
Display "Total Class Cost is $" , classCost
Display "Total Tech Fee is $" , techFee
Display "Total Bill including tech fee is $" , totalBill
End while
End Module
Modify the above pseudocode design to do the following: (FYI: Please modify the existing code only in Pseudocode)
- As the student adds courses, load an array named courses[ ] with the course name.
- As the student adds courses, load a parallel array named cost[ ] with the cost of that course.
- Use the cost[ ] array to calculate the total bill. Be sure that you are not duplicating the totaling logic in you project solution. It should be clean, simple code.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,