Question

In: Computer Science

write program in Linux (virtual box) that will sell shoes in different prices (adidas,nike,puma) + delivery...

write program in Linux (virtual box) that will sell shoes in different prices (adidas,nike,puma) + delivery fee

*get costumer's address

*how many the customer order the shoes

*Calculate total invoice

*display the invoice to tell the user how much the order will cost

(note: take a picture with comments of the input and output) thank you

Solutions

Expert Solution

NOTE: I have completed answers for your question along with explanation. Please check and let me know if you have any questions. I will revert back within 24 hours. Thanks for your patience.

Code:

#!/bin/bash

delivery_cost=300

adidas_cost=2000
nike_cost=2500
puma_cost=1500

echo "Enter customer address? "
read cust_addr

echo "Enter number of Adidas shoes you want to buy? "
read adidas_shoes
echo "Enter number of Nike shoes you want to buy? "
read nike_shoes
echo "Enter number of puma shoes you want to buy? "
read puma_shoes

adidas=`expr $adidas_shoes \* $adidas_cost`
nike=`expr $nike_shoes \* $nike_cost`
puma=`expr $puma_shoes \* $puma_cost`

total_cost=`expr $adidas + $nike + $puma`
total=`expr $total_cost + $delivery_cost`

id=`echo $$`
dat=`date`

echo "=============================================================================================================================="
echo -e "\t\t\t\tINVOICE"
echo "=============================================================================================================================="

echo -e "BILL TO"
echo -e "$cust_addr"
echo -e "SHIP TO"
echo -e "$cust_addr"
echo -e "\nINVOICE#\tUS-${id}\t\t\t\t\tINVOICE DATE:\t$dat"

echo "=============================================================================================================================="
echo -e "\tINVOICE TOTAL\t\t\t\t\t\t$total"
echo "=============================================================================================================================="

echo -e "QTY\tDESCRIPTION\tUNIT PRICE\tAMOUNT"
echo -e "\n"
echo -e "1\tAdidas Shoes\t$adidas_cost\t\t$adidas"
echo -e "2\tNike Shoes\t$nike_cost\t\t$nike"
echo -e "3\tPuma Shoes\t$puma_cost\t\t$puma"
echo -e "\n\n"
echo -e "\t\t\tSUBTOTAL: \t$total_cost"
echo -e "\t\t\tDelivery fee: \t$delivery_cost"


Code output screenshot:


Related Solutions

Nike was sued by Adidas for infringing on their patent for running shoes. The CEO of...
Nike was sued by Adidas for infringing on their patent for running shoes. The CEO of Nike is confident that they will win the case, but the firm is spending $1 million per year on this litigation and it will go on for 4 more years. The interest rate is 5%. Suppose Nike wants to stop dealing with the distraction, how much would Nike have to pay an external firm to take full responsibility of the case? Assume that Nike’s...
Compare Nike and Adidas estimated stock prices with actual stock prices as of January 2, 2019....
Compare Nike and Adidas estimated stock prices with actual stock prices as of January 2, 2019. Then tell whether each stock is undervalued or fair-valued or overvalued based on your estimation. What’s your decision if you hold these stocks? What’s your decision if you don’t hold these stocks? 1. Using annual stock price between 2013 and 2018, compute the following returns. For stock price data, use the closing price of the last trading day of the year: 1) Total Dollar...
Adding Value in Nike’s Production Line,” research your favorite brand of shoes (Nike, Adidas, New Balance,...
Adding Value in Nike’s Production Line,” research your favorite brand of shoes (Nike, Adidas, New Balance, etc) and answer the following questions: Has the company experienced declining or increased cost attributed to computerization? Was variable cost increased or decreased? Were fixed cost increased or decreased.
use linux or c program. please provide the answer in details. Write a program that will...
use linux or c program. please provide the answer in details. Write a program that will simulate non - preemptive process scheduling algorithm: First Come – First Serve Your program should input the information necessary for the calculation of average turnaround time including: Time required for a job execution; Arrival time; The output of the program should include: starting and terminating time for each job, turnaround time for each job, average turnaround time. Step 1: generate the input data (totally...
DISCUSS COMPARING TEXT EDITORS IN LINUX. Research the different text editors available in Linux and write...
DISCUSS COMPARING TEXT EDITORS IN LINUX. Research the different text editors available in Linux and write up a comparison of each. Your comparison should include a recommendation as to the editor you feel would be most useful and why.
please write in c using linux or unix Write a program that will simulate non -...
please write in c using linux or unix Write a program that will simulate non - preemptive process scheduling algorithm: First Come – First Serve Your program should input the information necessary for the calculation of average turnaround time including: Time required for a job execution; Arrival time; The output of the program should include: starting and terminating time for each job, turnaround time for each job, average turnaround time. Step 1: generate the input data (totally 10 jobs) and...
Please write in C using linux or unix. Write a program that will simulate non -...
Please write in C using linux or unix. Write a program that will simulate non - preemptive process scheduling algorithm: First Come – First Serve Your program should input the information necessary for the calculation of average turnaround time including: Time required for a job execution; Arrival time; The output of the program should include: starting and terminating time for each job, turnaround time for each job, average turnaround time. Step 1: generate the input data (totally 10 jobs) and...
Introduction Write in C++ at the Linux command line a program that is the same as...
Introduction Write in C++ at the Linux command line a program that is the same as the previous collection app project but now uses a class to store the items and also can save the items to a file that can be read back into the array by the user when the program is re-started. You can use your project 1 submission as a starting point or you can do something new as long as it meets the listed requirements....
IN C LANGUAGE: Write a multi-threaded Linux program that synchronizes it's threads to write to a...
IN C LANGUAGE: Write a multi-threaded Linux program that synchronizes it's threads to write to a file without the file becoming corrupted. To do this, your program will create three threads which write strings to the same file. Each thread will randomly write a selection of strings to the file at random intervals. When finished, the file will contain all the strings written correctly to the file. You may use mutexes, semaphores, or a monitor your write on your own....
Why might a company sell its products for different prices in different markets even if the...
Why might a company sell its products for different prices in different markets even if the income levels of its target consumers were the same in all cases?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT