1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zvonat [6]
3 years ago
15

Write assembly programs with the following I/O

Computers and Technology
1 answer:
Nat2105 [25]3 years ago
5 0

Answer:

Explanation:

copy to code:

#include <iostream>

#include <string>

using namespace std;

int main()

{

//total bill amount

float totalBill=0;

//no of customers

int noOfCustomer=0;

//no of drinks

int noOfDrinks;

//drink type

char drinkType;

//no of sandwiches

int noOfSandwiches;

int sandWitchSize;

cout<<"Enter the number of customers : ";

cin>>noOfCustomer;

//loop through no of customers

for(int i=1;i<=noOfCustomer;i++){

totalBill=0;

cout<<"Enter how many drinks ? ";

cin>>noOfDrinks;

cout<<"Enter what kind of drink (S=Soda ,W=Water) ";

cin>>drinkType;

if(drinkType=='w' || drinkType=='W'){

totalBill +=noOfDrinks*1;

}else if(drinkType=='s' || drinkType=='S'){

totalBill +=noOfDrinks*2;

}

cout<<"How many Sandwiches : ";

cin>>noOfSandwiches;

cout<<"What size of sandwich (10/12 inches) ? :";

cin>>sandWitchSize;

if(sandWitchSize==10){

totalBill+= noOfSandwiches*3;

}else if(sandWitchSize==12){

totalBill+= noOfSandwiches*5;

}

cout<<"Your total bill "<<totalBill<<endl;

}

return 0;

}

Enter the number of customers : 2

How many drinks? 2

What kind of drink(S=Soda and W=Water)? w

How many sandwiches? 3

What size of sanwich(10/12inches) ? 12

Your total bill = $ 17

How many drinks? 4

What kind of drink(S=Soda and W=Water)? s

How many sandwiches? 4

What size of sanwich(10/12inches) ? 10

Your total bill = $ 20

You might be interested in
Codio Challenge Question (Python)
Agata [3.3K]

Answer:

if speed1 > 70 or speed2 > 70:

print("fast cars")

else:

print("ok")

Explanation:

This is some very simple logic that will satisfy the requirements, we need to compare each speed against our speed limit (70) and if either (or) have exceeded it (>) then we need to output (print) "fast cars", otherwise we output "ok".

7 0
3 years ago
Which vpn protocol is a poor choice for high-performance networks with many hosts due to vulnerabilities in ms-chap?
blsea [12.9K]
PPTP is what uses chap-secrets. So I imagine that's it
3 0
3 years ago
I am wasting 20 points
OverLord2011 [107]
Okkkkkkkkkkkkkkkkkkkkkkk
3 0
3 years ago
Read 2 more answers
Lisa adds her co-worker Renald to a meeting and removes her secretary Olivia from the meeting. What will happen as a result?
VARVARA [1.3K]
There will be 1 person going, and there will be no secretary at the meeting
5 0
3 years ago
Read 2 more answers
Write a program with the total change amount as an integer input, and output the change using the fewest coins, one coin type pe
riadik2000 [5.3K]

Answer:

In Python:

cents = int(input("Cents: "))

dollars = int(cents/100)

quarters = int((cents - 100*dollars)/25)

dimes = int((cents - 100*dollars- 25*quarters)/10)

nickels = int((cents - 100*dollars- 25*quarters-10*dimes)/5)

pennies = cents - 100*dollars- 25*quarters-10*dimes-5*nickels

if not(dollars == 0):

   if dollars > 1:

       print(str(dollars)+" dollars")

   else:

       print(str(dollars)+" dollar")

if not(quarters == 0):

   if quarters > 1:

       print(str(quarters)+" quarters")

   else:

       print(str(quarters)+" quarter")

if not(dimes == 0):

   if dimes > 1:

       print(str(dimes)+" dimes")

   else:

       print(str(dimes)+" dime")

if not(nickels == 0):

   if nickels > 1:

       print(str(nickels)+" nickels")

   else:

       print(str(nickels)+" nickel")

if not(pennies == 0):

   if pennies > 1:

       print(str(pennies)+" pennies")

   else:

       print(str(pennies)+" penny")

   

Explanation:

A prompt to input amount in cents

cents = int(input("Cents: "))

Convert cents to dollars

dollars = int(cents/100)

Convert the remaining cents to quarters

quarters = int((cents - 100*dollars)/25)

Convert the remaining cents to dimes

dimes = int((cents - 100*dollars- 25*quarters)/10)

Convert the remaining cents to nickels

nickels = int((cents - 100*dollars- 25*quarters-10*dimes)/5)

Convert the remaining cents to pennies

pennies = cents - 100*dollars- 25*quarters-10*dimes-5*nickels

This checks if dollars is not 0

<em>if not(dollars == 0):</em>

If greater than 1, it prints dollars (plural)

<em>    if dollars > 1:</em>

<em>        print(str(dollars)+" dollars")</em>

Otherwise, prints dollar (singular)

<em>    else:</em>

<em>        print(str(dollars)+" dollar")</em>

This checks if quarters is not 0

<em>if not(quarters == 0):</em>

If greater than 1, it prints quarters (plural)

<em>    if quarters > 1:</em>

<em>        print(str(quarters)+" quarters")</em>

Otherwise, prints quarter (singular)

<em>    else:</em>

<em>        print(str(quarters)+" quarter")</em>

This checks if dimes is not 0

<em>if not(dimes == 0):</em>

If greater than 1, it prints dimes (plural)

<em>    if dimes > 1:</em>

<em>        print(str(dimes)+" dimes")</em>

Otherwise, prints dime (singular)

<em>    else:</em>

<em>        print(str(dimes)+" dime")</em>

This checks if nickels is not 0

<em>if not(nickels == 0):</em>

If greater than 1, it prints nickels (plural)

<em>    if nickels > 1:</em>

<em>        print(str(nickels)+" nickels")</em>

Otherwise, prints nickel (singular)

<em>    else:</em>

<em>        print(str(nickels)+" nickel")</em>

This checks if pennies is not 0

<em>if not(pennies == 0):</em>

If greater than 1, it prints pennies (plural)

<em>    if pennies > 1:</em>

<em>        print(str(pennies)+" pennies")</em>

Otherwise, prints penny (singular)

<em>    else:</em>

<em>        print(str(pennies)+" penny")</em>

<em>    </em>

4 0
3 years ago
Other questions:
  • Consider the following JavaScript program:
    8·1 answer
  • Common input devices include the keyboard, ____, and integrated video cameras.
    12·1 answer
  • As the design phase of an SDLC begins, programming languages, development tools, and application software needed for the new inf
    13·1 answer
  • A company that offers services for accessing and using the Internet is: *
    10·1 answer
  • Can someone pls help me my notifications aren’t working, I need help ASAP ty!
    5·1 answer
  • 1. Answer the following questions: a. What are the different types of number system? Name them.​
    8·1 answer
  • Hello im looking for someone to answer my question. Its about a coding project called "Quiz Master". Im having trouble with the
    7·1 answer
  • What social media profession entails determining how and in what way an organization will create and maintain a social media pre
    7·1 answer
  • You need to implement a class that represents the state of a room or game section. The class will contain a room_id, a descripti
    15·1 answer
  • What refers to a set of instructions executed in order?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!