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
jok3333 [9.3K]
3 years ago
8

What is the output of the following code snippet if the variable named cost contains 100? if cost < 70 or cost > 150 : dis

count = 0.8 * cost else : discount = cost print("Your cost is ", discount)
Computers and Technology
1 answer:
DanielleElmas [232]3 years ago
6 0

Answer:

The output is: Your cost is  100

Explanation:

Given

The above code snippet

and

cost = 100

Required

Determine the output of the code

if cost < 70 or cost > 150

The above condition checks if cost is less than 70 or cost is greater than 150

This condition is false because 100 is neither less than 70 nor is it greater than 150

So, the else statement will be executed.

discount = cost

Which means

discount = 100

So, the print instruction will print: Your cost is  100

You might be interested in
I dont know how to put the negative sigh on my computer
valina [46]
You put the dash on the right side up top ape
8 0
2 years ago
Read 2 more answers
Create a java class for Bank Accounts with these public String attributes: ownerName, acctNbr and these private double attribute
Readme [11.4K]

Answer:

public class BankAccounts

 {

   public String ownerName;

   public String acctNbr;

   private double debits;

   private double credits;

   public BankAccounts(String ownerNm, String acNum)

  {

    debits = 0;

    credits = 0;

    ownerName = ownerNm;

    acctNbr = acNum;

  }

public void addDebit(double debitAmt)

  {

    if(credits > (debits + debitAmt))

      debits = debits + debitAmt;

    else

      System.out.println("Insufficient balance");

}

   public void addCredit(double creditAmt)

  {

    credits = credits + creditAmt;

  }

public double getBalance()

  {

    double balance = 0;

    if((credits - debits) > 0)   // return the value if there is actually some balance left.

      balance = credits - debits;

    return balance;   //returns 0 if credits are lesser or equal to debits

  }

 }

Explanation:

Here class name is <em>BankAccounts </em>which can be used to create a new bank account whenever any user wants to open a bank account. This class will help to track any new account opening, debits and credits operations carried out on that account.

We have a constructor here, which accepts 2 arguments i.e. Bank account <em>Owner Name</em> and <em>Account Number</em>. The constructor also sets the values of <em>debits </em>and <em>credits</em> as 0.

The methods <em>addDebit()</em>, <em>addCredit()</em> and <em>getBalance()</em> help to perform Debit and Credit operations on the account.

NOTE: The method <em>getBalance()</em> returns a positive value only when credits are greater than debits.

The method <em>addDebits()</em> can add debits only as the condition that the credits are greater than the resultant debits.

The code for class <em>BankAccounts</em> is hereby attached.

Download java
4 0
3 years ago
Which cell formatting is most likely to use $?
TiliK225 [7]
Currency is the correct answer
4 0
3 years ago
Read 2 more answers
ANYBODY WANNA PLAY FoRnITe
ValentinkaMS [17]

Answer:

No but my baby brother can play with u

6 0
3 years ago
Read 2 more answers
What is pressure?
Licemer1 [7]
"force per unit area" because pressure is force per unit area.

hope this helped
6 0
3 years ago
Read 2 more answers
Other questions:
  • Write an interactive Python calculator program. The program should allow the user to type a mathematical expression, and then pr
    13·1 answer
  • Read the scenario below. Explain why this is not fair use of copyright materials. What should you do instead of using the entire
    10·1 answer
  • Human factors is the study of:
    5·1 answer
  • Andy is trying to put together a holiday gift knapsack (with W=8) for Sarah. He has n items to choose from, each with infinitely
    15·1 answer
  • ___ is an example of a function prototype.
    12·1 answer
  • 22. A<br> allows one computer to input data into another computer.
    6·1 answer
  • Which component of a word processor displays the name of the document?
    13·1 answer
  • How are computers used in education and entertainment? List them.​
    10·1 answer
  • Is Invader Zim gonna come back?
    7·1 answer
  • Write a boolean expression that is true if s references the string end.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!