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
How to send a message to another channel with an emoji slack
Advocard [28]

Answer: Tap and hold the message you'd like to share and select Share message. Tap the #channel name and choose where you'd like to share the message. Add an optional note, if you'd like. Tap the paper plane icon to share.

Explanation:

7 0
3 years ago
Suppose that a 2M x 16 main memory is built using 256kB x 8 RAM chips and memory is word addressable, how many RAM chips are nec
hoa [83]

Answer:

16 RAM chips

Explanation:

To calculate the number of RAM chips needed, we divide the total size of the main memory by the size of each RAM chip. Hence:

Number of RAM chips required = Main memory size / size of one RAM

2M = 2²¹, 16 = 2⁴, 256K = 2¹⁸, 8 = 2³

Hence:

Number of RAM chips required = (2²¹ * 2⁴) / (2¹⁸ * 2³) = 2⁴ = 16

Therefore 16 RAM chips are necessary

5 0
3 years ago
There is a flashing yellow light at the intersection you are approaching. What does the flashing yellow light indicate, and what
Ilia_Sergeevich [38]
The flashing yellow light indicates that people should be aware of other cars and turn carefully. To be more safe, you should slightly slow down, make sure all signals that should be on are on, and you should drive very carefully.
6 0
3 years ago
Assume the availability of a function is_prime. Assume a variable n has been associated with positive integer. Write the stateme
vivado [14]

Answer:

def main():

   n = int(input('Enter the value of the variable n:'))

   k=2;

   totalSum = 0

   print('The list of the prime numbers are as follows:')

   while k <= n:

       totalSum = totalSum+is_prime(k)

       k=k+1

   print('Total sum of the prime numbers:',totalSum)

def is_prime(k):

   primeNumber = 0      

   i=1

   while i<=int(k):

       if (k % i) == 0:

           primeNumber = primeNumber + 1

       i=i+1

   if(primeNumber==2):      

       print(k)

       return k;

   else:        

       return 0;

main()

Explanation:

  • Run the while loop until k is less than n.
  • Determine if the variable k is prime then add it to the totalSum variable.
  • Increment the value of k by 1.
  • Create a function isPrime to check whether the number is prime  or not by determining the factors of k which can be found using the modulus operator.
  • Call the main function at the end.

6 0
3 years ago
Write a program to input the length and width of a rectangle and calculate and print the perimeter and area of the rectangle.
Phantasy [73]

\tt L=(float(input("Enter\:Length\:of\:rectangle=")))

\tt B=(float(input("Enter\:Breadth\:of\:the\:rectangle=")))

\tt P=2*(L+B)

\tt A=L*B

\tt print("Perimeter\:of\:the\:rectangle=",P)

\tt print("Area\:of\:the\:rectangle=",A)

7 0
3 years ago
Other questions:
  • How do you enlarge your screen if there is no control panel? Need desperate help!
    15·1 answer
  • A person who enjoyed making paper airplanes as a child might very well find a satisfying career as a(n) _____ engineer.
    7·2 answers
  • Some personal computer manufacturers provide a hard disk configuration that connects multiple smaller disks into a single unit t
    6·1 answer
  • How can you check an orthographic drawing to be sure there are no missing lines
    11·1 answer
  • Bonnie gets very nervous before taking tests. What can she do to help her anxiety while she takes her tests?
    15·2 answers
  • A _____ is inserted so that a portion of a document that can have different formatting from the rest of the document. a. heading
    9·1 answer
  • What is interest? How does interest affect credit card purchases?
    11·1 answer
  • Anyone know how to translate this 1100111111110100000110 pls n ty!4!:$;
    15·2 answers
  • why does my Minecraft screen this "play and "settings" instead of the regular layout with singleplayer, multiplayer, and options
    11·2 answers
  • The packet storm web site includes a large collection of packaged shellcode, including code that can:_____.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!