Question

In: Computer Science

According to the university's website design request, students need to order five books, one for each...

According to the university's website design request, students need to order five books, one for each of the five required courses that all students take. You need to design a program that will prompt students for the price of each book and display the total cost for the five books.

The university reassessed its needs for the website design and determined it will no longer require all students to take five classes.

Update the website program to reflect the following changes:

  • Prompt the student for the number of courses being taken
  • Use a while loop to prompt the student for the price of each book based upon the number of classes being taken
  • After the price of each book has been entered, prompt the user for shipping options: delivery or pick-up
  • Use an if statement to add the charges to the total price if the shipping charges are greater than 0
  • Display the total cost

Create a 1/2- to 1-page document containing pseudocode based on the revised program needs.

Create a 1-page flowchart based on the algorithm for the revised program needs.

Solutions

Expert Solution

****This requires a lot of effort so please drop a like if you are satisfied with the solution****

I have written the pesudo code as comments in js code...

index.html:

<html>

    <head>

        <script src="index.js"></script>

    </head>

    <body></body>

</html>

index.js

// ->Declaration

//     declare a variable to store no of no of subjects

//     declare a variable i and intialise it to 1

//     declare a variable to calculate and store the total price

// ->Reading input from prompts

//     run a while until i is less than no of subjects

//         read the price of books and add it to total_price

//         increment i by 1

// ->checking shipping charges

//     prompt the user to enter shipping details -> Delivery/pickup

//     if read value is equal to "delivery"

//         then add shipping charges 50 to the total price

//         WritableStream total price

//     else write total price

noOfSubjects=window.prompt("Enter number of subjects")

i=1

total_price=0

books=""

while(i<=noOfSubjects){

    price=Number(window.prompt("Enter book "+i+" price"))

    total_price+=price;

    books+="book "+i+" price : "+price+"\n"

    i+=1

}

shipping_cost=window.prompt("Delivery/Pickup ?")

if(shipping_cost.toLowerCase()=="delivery"){

    console.log("here")

    total_price+=50

    books+="Shipping Charges : 50 "

    document.write(books)

    document.write("Total Price is : "+total_price)

}else{

    books+="Shipping Charges : 0 "

    document.write(books)

    document.write("Total Price is : "+total_price)    

}


Flow Chart:


Related Solutions

I need to have someone design a website using Code one JavaScript server application using Node.js...
I need to have someone design a website using Code one JavaScript server application using Node.js for routing, Express.jsfor framework and Handlebars.js for templating Necessary npm modules are: express, express-handlebars, path and body-parser - it willl have a drop down box with 5 names of titles of a picture. - highlite 1 name in dropdown box and there is a select button to make web site go to that picture stored on server.. this is my third question on this...
List the five steps in the risk management process (in order) and describe each one in...
List the five steps in the risk management process (in order) and describe each one in at least one sentence: (5 pts.) ________________________________________________________________________ ________________________________________________________________________ ________________________________________________________________________ ________________________________________________________________________ ________________________________________________________________________ The following is the probability distribution of rate of return for a particular stock: (5 pts.) Rate of Return Probability 20% 0.30 5% 0.40 -10% 0.30 What is the expected return of this stock? What is the standard deviation of the expected return? What is the confidence interval of the expected return within...
According to the website www.collegedrinkingprevention.gov, “About 25 percent of college students report academic consequences of their...
According to the website www.collegedrinkingprevention.gov, “About 25 percent of college students report academic consequences of their drinking including missing class, falling behind, doing poorly on exams or papers, and receiving lower grades overall.” A statistics student is curious about drinking habits of students at his college. He wants to estimate the mean number of alcoholic drinks consumed each week by students at his college. He plans to use a 99% confidence interval. He surveys a random sample of 55 students....
According to the website www.collegedrinkingprevention.gov, “About 25 percent of college students report academic consequences of their...
According to the website www.collegedrinkingprevention.gov, “About 25 percent of college students report academic consequences of their drinking including missing class, falling behind, doing poorly on exams or papers, and receiving lower grades overall.” A statistics student is curious about drinking habits of students at his college. He wants to estimate the mean number of alcoholic drinks consumed each week by students at his college. He plans to use a 99% confidence interval. He surveys a random sample of 55 students....
What are the four phases of website design and what is involved with each phase?
What are the four phases of website design and what is involved with each phase?
Assume you request a webpage consisting of one document and five images. The document size is...
Assume you request a webpage consisting of one document and five images. The document size is 1 kbyte, all images have the same size of 50 kbytes, the download rate is 1 Mbps, and the RTT is 100 ms. How long does it take to obtain the whole webpage under the following conditions? (Assume no DNS name query is needed and the impact of the request line and the headers in the HTTP messages is negligible). a. Nonpersistent HTTP with...
Q: 5   Design an educational program for changing the stay behaviour of students according to the...
Q: 5   Design an educational program for changing the stay behaviour of students according to the prevention and control of COVID-19 based on the theory of planned behaviour. With at least 2 references, at least 4-5 line answer
Computer Science, Website Design, Enhanced Business Technology Write three paragraphs (4-7 sentences each) with three website...
Computer Science, Website Design, Enhanced Business Technology Write three paragraphs (4-7 sentences each) with three website references (i.e. quotes from websites) on Ajax technology and/or its business implications.
Q: 6 Design an educational program for changing the social distancing behaviour of students according to...
Q: 6 Design an educational program for changing the social distancing behaviour of students according to the prevention and control of COVID-19 based on the transtheoretical model of change. With at least 2 references, at least 4-5 line answer
Bank One just approved a loan for Dante Inc. to start a website design and maintenance...
Bank One just approved a loan for Dante Inc. to start a website design and maintenance business. Dante Inc. is ready to purchase needed equipment, hire administrative help, and begin designing websites. During June, Dante’s first month of business, the following transactions occurred: Dante Inc. signed a note at the bank and received $20,000 cash. Dante issued shares of capital stock to its shareholders in the amount of $3,000 cash. Dante purchased a new computer and additional equipment for $3,000...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT