4: The Summerville telephone company charges 10 cents per minutes for all calls
ID: 3626541 • Letter: 4
Question
4: The Summerville telephone company charges 10 cents per minutes for all calls outside the customers area code that last over 20 minutes. All other calls are 13 cents per minute. Design a flowchart or psuedocode for the following.4A: A program that accepts the following data about one phone call: customer area code, customer phone number, called are code, called number, and call time in minutes. Display the calling number, called number, and price for the call.
Start
declarations
num custAreaCode
num custPhoneNum
num calledAreaCode
num calledPhoneNum
num minutes
num price
num Low_Price = .10
num High_Rate = .13
num Time_Limit = 20
input custAreaCode
input custPhoneNum
input calledAreaCode
input calledPhoneNum
input minutes
I if custAreaCode ? calledAreaCode ?minutes >Time_Limit then
price = minutes * Low_Rate
else
price = minutes * High_Rate
endif
output custAreaCode
output custPhoneNum
output calledAreaCode
output calledPhoneNum
output price
stop
7:Rick Hammer is a carpenter who wants an application to compute the price of any desk a customer orders, based on the folloowing: desk length and width in inches, type of wood, and numbers of drawers. The price is computed as follows.
7a: A program that accepts data for an order number, customer name, length and width of the desk ordered, type of wood, and number of drawers. Display all the entered data and the final price for the desk.
start
Declarations
string name
num order
num length
num width
Num wood
Num drawer
Num basePrice = 200
Num limit = 200
Num limitMax = 50
Num oakMax = 125
num pineMax = 0
Num mahoganyMax = 150
Num perDrawer = 30
Num cost
Num deskQuantity
Housekeeping()
While Cost = basePrice
detailLoop()
end()
stop
Diana Lee, a supervisor in a maufacturing company, wants to know which employees have increased their production this year over last year. These employees will recieve certification of commendation and bonuses. Design a flowchart or psuedocode for the following
9a: A program that continuously accepts each worker’s first and last names, this years number of units produced, and last yeats number of units produced. Display eash employee with a messege indicating whether the employees production has increased over the last years productions.
start
declarations
string = firstName
string = lastName
string = terminateProgram
string = “TTL”= end program
num = currrentYearUnits
num = previousYearUnits
while (terminateProgram = “TTL””
output “ enter first name”
input firstName
output “ enter last name”
input lastName
output “ enter current year units”
input currentYearUnits
output “ enter previous year units”
input previousYearUnits
if currentYearUnits > previousYearUnit then
display “ employees productivity has declined since the previous year units”
else
display “ employees productivity is equal to the previous year units”
endif
output “enter TTL to end program”
input TTL
stop
Explanation / Answer
4: The Summerville telephone company charges 10 cents per minutes for all calls outside the customers area code that last over 20 minutes. All other calls are 13 cents per minute. Design a flowchart or psuedocode for the following.
4A: A program that accepts the following data about one phone call: customer area code, customer phone number, called are code, called number, and call time in minutes. Display the calling number, called number, and price for the call.
Start
declarations
num custAreaCode
num custPhoneNum
num calledAreaCode
num calledPhoneNum
num minutes
num price
num Low_Price = .10
num High_Rate = .13
num Time_Limit = 20
input custAreaCode
input custPhoneNum
input calledAreaCode
input calledPhoneNum
input minutes
if custAreaCode not equal to calledAreaCode and minutes >Time_Limit then "The Summerville telephone company charges 10 cents per minutes for all calls outside the customers area code that last over 20 minutes. All other calls are 13 cents per minute."
price = minutes * Low_Rate
else
price = minutes * High_Rate
endif
output custAreaCode
output custPhoneNum
output calledAreaCode
output calledPhoneNum
output price
stop
7:Rick Hammer is a carpenter who wants an application to compute the price of any desk a customer orders, based on the folloowing: desk length and width in inches, type of wood, and numbers of drawers. The price is computed as follows.
How is the price computed?
7a: A program that accepts data for an order number, customer name, length and width of the desk ordered, type of wood, and number of drawers. Display all the entered data and the final price for the desk.
start
Declarations
string name
num order
num length
num width
Num wood
Num drawer
Num basePrice = 200
Num limit = 200
Num limitMax = 50
Num oakMax = 125
num pineMax = 0
Num mahoganyMax = 150
Num perDrawer = 30
Num cost
Num deskQuantity
Housekeeping()
While Cost = basePrice
detailLoop() what is detailLoop()? It's not mentioned in the problem.
endwhile ?
end()
stop
Diana Lee, a supervisor in a maufacturing company, wants to know which employees have increased their production this year over last year. These employees will recieve certification of commendation and bonuses. Design a flowchart or psuedocode for the following
9a: A program that continuously accepts each worker’s first and last names, this years number of units produced, and last yeats number of units produced. Display eash employee with a messege indicating whether the employees production has increased over the last years productions.
start
declarations
string = firstName
string = lastName
string = terminateProgram
string = “TTL”= end program
num = currrentYearUnits
num = previousYearUnits
while (terminateProgram = “TTL””
output “ enter first name”
input firstName
output “ enter last name”
input lastName
output “ enter current year units”
input currentYearUnits
output “ enter previous year units”
input previousYearUnits
if currentYearUnits > previousYearUnit then I think you have this backwards
display “ employees productivity has declined since the previous year units”
else
display “ employees productivity is equal to the previous year units”
endif
output “enter TTL to end program”
input TTL
endwhile
stop
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.