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
g Design a Boolean function called isPrime, that accepts an integer as an argument and returns True if the argument is a prime n
professor190 [17]

Answer:

#include <bits/stdc++.h>

using namespace std;

bool isPrime(int n)

{

   for(int j=2;j<=n-1;j++)  //loop to check prime..

   {

       if(n%j==0)

       return false;

   }

   return true;

}

int main(){

   int n;

   cout<<"Enter the integer"<<endl;//taking input..

   cin>>n;

   if(isPrime(n))//printing the message.

   {

       cout<<"The number you have entered is prime"<<endl;

   }

   else

   {

       cout<<"The number is not prime"<<endl;

   }

return 0;

}

Output:-

Enter the integer

13

The number you have entered is prime

Explanation:

The above written program is in C++.I have created a function called isPrime with an argument n.I have used a for loop to check if the number is prime or not.In the main function I have called the function isPrime for checking the number is prime or not.

4 0
3 years ago
Jim has just purchased two new SCSI hard disk drives and a controller card for them. He properly installs the hardware in his ma
yawa3891 [41]

Answer:

  • Create partitions on each hard disk drives.
  • Mount the partition created on each hard drive so they are accessible by the the operating system.
  • Format the partitions created with a filesystem recognized by Linux.

Explanation:

Having purchased the two new SCSI hard disk drives with the controller cards for each and installed them properly, before using them for data storage and retrieval he must first use the fdisk command to create one or more partitions on each of the hard disk drives then mount any partitions created on the two hard drives so that they are accessible by the operating system before then proceeding to format any partitions created with a valid filesystem recognized by Linux.

4 0
3 years ago
The definition of HTTP makes use of the ASCII character set without reference to how these characters are encoded. Explain why t
solniwko [45]
Abstraction comes from two latin words; abs which means away and trahere which mean to draw. From the meaning itself, it is to draw away something from specific objects, individuals, group, etc. In the computer world, a programmer hides all relevant data pertaining to the relevance of a data. It is done to increase efficiency and and reduce complexity. 
4 0
3 years ago
Read 2 more answers
Revenue xls en excel
igor_vitrenko [27]
Whast does this mean

5 0
3 years ago
Exercise 3.16.4: Happy Face Solita
enot [183]

first do a happy face and a circule thats it

7 0
3 years ago
Other questions:
  • Adam would like to reduce the size of an image that he inserted into a document. He selects the image and chooses the Crop optio
    11·2 answers
  • What term is used to describe a function that uses an algorithm to convert an input of letters and numbers into an encrypted out
    9·1 answer
  • What are three steps to use to research relevant information on the internet? (Site 1)
    13·2 answers
  • The operating system provides a ____, which is the means with which you interact with the computer
    5·1 answer
  • Write a method body for the static method isDivisibleBy5 shown below. The only NaturalNumber methods you are allowed to use are
    12·1 answer
  • How is the go button on m computer?
    10·1 answer
  • What is the output?
    12·1 answer
  • In what ways can you modify the location of the neutral point?
    11·1 answer
  • Do pc players ever go outside?
    11·2 answers
  • Describe the method used by operating systems to differentiate between TCP connections.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!