You are required to do multithreading on generated receipt. You will create 5 threads. Thread 1: select the number of it

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

You are required to do multithreading on generated receipt. You will create 5 threads. Thread 1: select the number of it

Post by answerhappygod »

You are required to do multithreading on generated receipt. You will create 5 threads. Thread 1: select the number of items you purchased. Display the prices of all items as (Quantity x Price of the individual) add them, and return their sum.
Thread 3: Calculate 8% tax on it.
Thread 4: If an order is greater than 250, Calculate 10% sale. Thread 5: Sort the items according to their prices.
Output: Thread 1: Items Purchased = eggs, bread, chocolate
eggs = 3 x 15=45 , bread = 1x 60 =60 , chocolate = 5 x 50 = 250, sum=45+60+250= 355 Thread 2 : 355/(1+0.8) = 197.22 , taxed sum=197.22+355= 552.33
Thread 3 : price=355 , sale =0.1 , 355*0.1=35.5 , 355-35.5 = 319.5
Thread 4:
Items Price
Chocolates 250
Bread 60
Eggs 45
You Are Required To Do Multithreading On Generated Receipt You Will Create 5 Threads Thread 1 Select The Number Of It 1
You Are Required To Do Multithreading On Generated Receipt You Will Create 5 Threads Thread 1 Select The Number Of It 1 (31.73 KiB) Viewed 33 times
It's C or C++
QUESTION NO. 01: You are required to do multithreading on generated receipt. You will create 5 threads. Thread 1: select the number of items you purchased. Display the prices of all items as (Quantity x Price of the individual) add them, and return their sum. Thread 3: Calculate 8% tax on it. Thread 4: If an order is greater than 250, Calculate 10% sale. Thread 5: Sort the items according to their prices. Output: Thread 1: Items Purchased = eggs, bread, chocolate eggs = 3 x 15-45, bread = 1x 60 =60, chocolate = 5 x 50 = 250, sum=45+60+250=355 Thread 2: 355/(1+0.8)= 197.22 , taxed sum=197.22+355= 552.33 Thread 3 : price=355, sale =0.1, 355*0.1=35.5, 355-35.5 = 319.5 Thread 4: Items Price Chocolates 250 Bread 60 eggs 45
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply