Question: Embedded systems Check-out System You need to use Serial communication, LED control and simple arrays (optional) for this application Setup: Connect 6 LEDs to 6

 Embedded systems Check-out System You need to use Serial communication, LED

Embedded systems

Check-out System You need to use Serial communication, LED control and simple arrays (optional) for this application Setup: Connect 6 LEDs to 6 pins of PORTB. Description: You are designing a billing program for a check-out system in a grocery that offers special discounts for its customers. Write a program that asks a cashier to enter the price of 6 items. As the prices are entered by the user, one LED goes on at a time. Once all the items have been entered, the program should display the bill as follows: Total price for all items. The total price after discount. Calculating discount: The discount is calculated as follows. Apply 50% discount to the cheapest item in the list and apply 10% discount to the most expensive item in the list. An example of how the program should work is given below. Controller: "Welcome, enter the price of 6 items one at a time." LEDs Controller: "item #1:" User input: 6.5 Controller: "item #2:" User input: 7.0 Controller: "item #3:" User input: 3.0 Controller: "item #4:" User input: 10.0 Controller: "item #5:" User input: 4.5 Controller: "item #6: User input: 9.0 Controller: "Total price: 40 Controller: "Price after discount: 37.5" Hint: keep track of the cheapest and most expensive item in the list. Check-out System You need to use Serial communication, LED control and simple arrays (optional) for this application Setup: Connect 6 LEDs to 6 pins of PORTB. Description: You are designing a billing program for a check-out system in a grocery that offers special discounts for its customers. Write a program that asks a cashier to enter the price of 6 items. As the prices are entered by the user, one LED goes on at a time. Once all the items have been entered, the program should display the bill as follows: Total price for all items. The total price after discount. Calculating discount: The discount is calculated as follows. Apply 50% discount to the cheapest item in the list and apply 10% discount to the most expensive item in the list. An example of how the program should work is given below. Controller: "Welcome, enter the price of 6 items one at a time." LEDs Controller: "item #1:" User input: 6.5 Controller: "item #2:" User input: 7.0 Controller: "item #3:" User input: 3.0 Controller: "item #4:" User input: 10.0 Controller: "item #5:" User input: 4.5 Controller: "item #6: User input: 9.0 Controller: "Total price: 40 Controller: "Price after discount: 37.5" Hint: keep track of the cheapest and most expensive item in the list

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!