answer.
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
quester [9]
1 year ago
7

Item = "quesadilla"

Computers and Technology
1 answer:
jok3333 [9.3K]1 year ago
7 0

Answer:

item = "quesadilla"

meat = "steak"

queso = False

guacamole = False

double_meat = False

base_price = 4.5

if item == "quesadilla":

base_price = 4.0

elif item == "burrito":

base_price = 5.0

if meat == "steak" or meat == "pork":

base_price += 0.50

if meat == "steak" and double_meat:

base_price += 1.50

elif meat == "pork" and double_meat:

base_price += 1.50

elif double_meat:

base_price += 1.0

if guacamole:

base_price += 1.0

if queso and item != "nachos":

base_price += 1.0

print(base_price)

Explanation:

  • Use a conditional statement to check if meat is steak or pork then add 0.50 to base_price .
  • Check if the meat is steak or pork, then double_meat adds 1.50 or 1.0 otherwise .
  • Check if meat is steak and its double_meat , then add 1.50  and if its for guacamole, then add 1.00 to base_price . If queso is there and item is not nachos, add 1.00 to base_price .
  • Finally when item is nachos, no need to add any money to base_price .

You might be interested in
Design an application for Bob's E-Z Loans. The application accepts a client's loan amount and monthly payment amount. Output the
zmey [24]

Answer:

part (a).

The program in cpp is given below.

#include <stdio.h>

#include <iostream>

using namespace std;

int main()

{

   //variables to hold balance and monthly payment amounts

   double balance;

   double payment;

   //user enters balance and monthly payment amounts

   std::cout << "Welcome to Bob's E-Z Loans application!" << std::endl;

   std::cout << "Enter the balance amount: ";

   cin>>balance;

   std::cout << "Enter the monthly payment: ";

   cin>>payment;

   std::cout << "Loan balance: " <<" "<< "Monthly payment: "<< std::endl;

   //balance amount and monthly payment computed

   while(balance>0)

   {

       if(balance<payment)    

         { payment = balance;}

       else

       {  

           std::cout << balance <<"\t\t\t"<< payment << std::endl;

           balance = balance - payment;

       }

   }

   return 0;

}

part (b).

The modified program from part (a), is given below.

#include <stdio.h>

#include <iostream>

using namespace std;

int main()

{

   //variables to hold balance and monthly payment amounts

   double balance;

   double payment;

   double charge=0.01;

   //user enters balance and monthly payment amounts

   std::cout << "Welcome to Bob's E-Z Loans application!" << std::endl;

   std::cout << "Enter the balance amount: ";

   cin>>balance;

   std::cout << "Enter the monthly payment: ";

   cin>>payment;

   balance = balance +( balance*charge );

   std::cout << "Loan balance with 1% finance charge: " <<" "<< "Monthly payment: "<< std::endl;

   //balance amount and monthly payment computed

   while(balance>payment)

   {

           std::cout << balance <<"\t\t\t\t\t"<< payment << std::endl;

           balance = balance +( balance*charge );

           balance = balance - payment;

       }

   if(balance<payment)    

         { payment = balance;}          

   std::cout << balance <<"\t\t\t\t\t"<< payment << std::endl;

   return 0;

}

Explanation:

1. The variables to hold the loan balance and the monthly payment are declared as double.

2. The program asks the user to enter the loan balance and monthly payment respectively which are stored in the declared variables.  

3. Inside a while loop, the loan balance and monthly payment for each month is computed with and without finance charges in part (a) and part (b) respectively.

4. The computed values are displayed for each month till the loan balance becomes zero.

5. The output for both part (a) and part (b) are attached as images.

4 0
1 year ago
Drag each tile to the correct box.
Likurg_2 [28]
Learning
planning
designing
developing
testing delivering
4 0
1 year ago
Value is always _____________ aligned in a cell. ​
Nadya [2.5K]

Answer:

Right

Explanation:

7 0
1 year ago
Write a program to declare a matrix A[][] of order (MXN) where ‘M’ is the number of rows and ‘N’ is the
Liula [17]

Answer:

import java.io.*;

import java.util.Arrays;

class Main {

   public static void main(String args[])

   throws IOException{

       // Set up keyboard input

       InputStreamReader in = new InputStreamReader(System.in);

       BufferedReader br = new BufferedReader(in);

 

       // Prompt for dimensions MxN of the matrix

       System.out.print("M = ");

       int m = Integer.parseInt(br.readLine());

       System.out.print("N = ");

       int n = Integer.parseInt(br.readLine());

       // Check if input is within bounds, exit if not

       if(m <= 2 || m >= 10 || n <= 2 || n >= 10){

           System.out.println("Matrix size out of range.");

           return;

       }

       // Declare the matrix as two-dimensional int array

       int a[][] = new int[m][n];

 

       // Prompt for values of the matrix elements

       System.out.println("Enter elements of matrix:");

       for(int i = 0; i < m; i++){

           for(int j = 0; j < n; j++){

               a[i][j] = Integer.parseInt(br.readLine());

           }

       }

       // Output the original matrix

       System.out.println("Original Matrix:");

       printMatrix(a);

       // Sort each row

       for(int i = 0; i < m; i++){

         Arrays.sort(a[i]);

       }

       // Print sorted matrix

       System.out.println("Matrix after sorting rows:");

       printMatrix(a);

   }

   // Print the matrix elements separated by tabs

   public static void printMatrix(int[][] a) {

       for(int i = 0; i < a.length; i++){

           for(int j = 0; j < a[i].length; j++)

               System.out.print(a[i][j] + "\t");

           System.out.println();

       }

   }

}

Explanation:

I fixed the mistake in the original code and put comments in to describe each section. The mistake was that the entire matrix was sorted, while only the individual rows needed to be sorted. This even simplifies the program. I also factored out a printMatrix() method because it is used twice.

4 0
1 year ago
Drag each label to the correct location on the image.
pantera1 [17]

Answer:

1.computer-based  training modules  is an example of hierarchical technique.

Explanation:

Computer based training modules are the example of hierarchical model or technique of website. In this technique courses or modules are linked with each other in hierarchical structure. To start some advance module we should learn some basic modules first.

2.school website is an example of Linear Structure of Website.

Explanation:

In linear structure of website, pages are linked in a sequence. We can follow the links to find some information in sequential manner.

3.bookstore  website is an example of Linear Structure of Website.

Explanation:

In linear structure of website, pages are linked in a sequence. We can follow the links to find some information in sequential manner.

4.single-product  websites is an example of Linear Structure of Website.

Explanation:

In linear structure of website, pages are linked in a sequence. We can follow the links to find some information in sequential manner.

5.county library  website is an example of Webbed technique.

Explanation:

Computer based training modules are the example of webbed model or technique of website. In this technique many pages are connected or linked to many other pages and each page can access any other page. This is a complex structure of website.

6.online gift store  website is an example of Linear Structure of Website.

Explanation:

In linear structure of website, pages are linked in a sequence. We can follow the links to find some information in sequential manner.

7.federal government  website is an example of Webbed technique.

Explanation:

Computer based training modules are the example of webbed model or technique of website. In this technique many pages are connected or linked to many other pages and each page can access any other page. This is a complex structure of website.

3 0
2 years ago
Other questions:
  • If you have long column labels with columns so wide that they affect the readability of a worksheet, you should first
    7·1 answer
  • Monica needs to work on a document where she has to highlight topics in bold and add emphasis to some words in a paragraph using
    9·1 answer
  • What is a typical grace period for a credit card...
    15·2 answers
  • _____________ involves the deployment of malware that secretly steals data in the computer systems of organizations, such as gov
    13·1 answer
  • For any element in keysList with a value greater than 50, print the corresponding value in itemsList, followed by a space. Ex: I
    8·1 answer
  • The Pentium 4 Prescott processor, released in 2004, had a clock rate of 3.6 GHz and voltage of 1.25 V. Assume that, on average,
    8·1 answer
  • Two-dimensional array indexes are listed as
    8·1 answer
  • Pick a 3D game you enjoy or know about. Pick a scene from that game that has at least one character in it and describe the scene
    9·1 answer
  • A laptop gets replaced if there's a hardware issue. Which stage of the hardware lifecycle does this scenario belong to?
    5·1 answer
  • The web development team is having difficulty connecting by ssh to your local web server, and you notice the proper rule is miss
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!