Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Accounting questions

Question

sharing of non-material benefits such as time and affection;

Answered: 1 week ago