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
dalvyx [7]
4 years ago
11

Write a Python program that prompts the user for the cost of two items to be purchased. Then prompt the user for payment. If the

amount entered is less than the total cost of the two items, print a message that states how much is still owed. Otherwise, print a thank you message and state how much change will be given.
Computers and Technology
1 answer:
Rama09 [41]4 years ago
7 0

Answer:

first_item = float(input("Enter the cost of your first item: "))

second_item = float(input("Enter the cost of your second item: "))

total = first_item + second_item

payment = float(input("Enter the amount you will be paying: "))

if payment < total:

   print("You still owe: " + str(total - payment))

else:

   print("Thank you. You will receive " + str(payment - total))

Explanation:

- Get the item costs from the user

- Calculate the <em>total</em>

- Get the <em>payment</em> from the user

- Compare the <em>payment</em> and <em>total </em>and print the appropriate message

You might be interested in
A = 250; B = 325. which of the following statements is true? A ==B A&gt;B A =B
Ivanshal [37]

Answer:

lollol

Explanation:

7 0
3 years ago
What is output by the following code?
Marysya12 [62]
Division in Java will return the integer value and disregard the remainder. This line of code will return 4.

:)
3 0
4 years ago
This assignment requires you to write a well documented Java program to calculate the total and average of three scores, the let
blsea [12.9K]

Answer:

The solution is given in the explanation section

Don't forget to add the pledge before submitting it. Also, remember to state the IDE which you are familiar with, I have used the intellij IDEA

Follow through the comments for a detailed explanation of each step

Explanation:

/*This is a Java program to calculate the total and average of three scores, the letter grade, and output the results*/

// Importing the Scanner class to receive user input

import java.util.Scanner;

class Main {

 public static void main(String[] args) {

   //Make an object of the scaner class

   Scanner in = new Scanner(System.in);

   //Prompt and receive user first and last name;

   System.out.println("Please enter your first name");

   String First_name = in.next();

   System.out.println("Please enter your Last name");

   String Last_name = in.next();

   //Prompt and receive The three integer scores;

   System.out.println("Please enter score for course one");

   int courseOneScore = in.nextInt();

   System.out.println("Please enter score for course two");

   int courseTwoScore = in.nextInt();

   System.out.println("Please enter score for course three");

   int courseThreeScore = in.nextInt();

   //Calculating the total scores and average

   int totalScores = courseOneScore+courseTwoScore+courseThreeScore;

   double averageScore = totalScores/3;

   /*Use if..Else statements to Determine a letter grade based on the following grading scale - 90-100 A; 80-89.99 B; 70-79.99 C; below 70 F */

   char letterGrade;

   if(averageScore>=90){

     letterGrade = 'A';

   }

   else if(averageScore>=80 && averageScore<=89.99){

     letterGrade = 'B';

   }

     else if(averageScore>=70 && averageScore<=79.99){

     letterGrade = 'C';

   }

   else{

     letterGrade ='F';

   }

   //Printing out the required messages

   System.out.printf("Name:  %s %s\n", First_name, Last_name);

   System.out.printf("scores: %d %d %d:  \n", courseOneScore, courseTwoScore, courseThreeScore);

   System.out.printf("Total and Average Score is: %d %.2f:  \n", totalScores, averageScore);

   System.out.printf("Letter Grade: %C:  \n", letterGrade);

  // System.out.printf("Total: %-10.2f:  ", dblTotal);

 }

}

3 0
3 years ago
Help me in this work sheet
andreyandreev [35.5K]

The correct matching of the given computer components/commands are:

  • Input- Data given to the computer
  • Output- Result provided by the CPU
  • Processing- CPU
  • Data storage- Memory

<h3>What is Input? </h3>

This refers to the process of giving raw data to a computer system that needs processing to be done to it.

Hence, we can see that based on the computer components and commands given in the image have all been correctly matched.

Read more about computer components here:

brainly.com/question/23339335

#SPJ1

4 0
2 years ago
Http, https, CSS, JavaScript, DHTML, and HTML are types of coding and formatting behind web pages.
Dovator [93]

Answer:

FALSE

Explanation:

HTTP ( Hyper text transfer protocol ) : HTTP is a protocol used by the world wide web and it defines how messages are formatted and transmitted, they are actually not part of the formatting and they also determines actions to be taken by web browsers in response to commands.

JavaScript, CSS, HTML  are all markup languages written in codes while creating a website/web page.

D HTML ( dynamic HTML ) is a collection of technologies like CSS, JAVA SCRIPT and HTML  to create Animated and interactive websites and this entails a lot of coding and formatting.

7 0
4 years ago
Read 2 more answers
Other questions:
  • Which of the following is NOT true of input validation?
    7·1 answer
  • Slmething about device for defrosting windscreen?
    5·1 answer
  • 2. What's the keyboard command that will allow you to "copy" text?
    8·2 answers
  • Items in the __________ area of a class are accessible to all entities that can "see" the object(s) of that class type
    10·1 answer
  • The company currently runs 60 autonomous APs and has plans to increase wireless density by 50% in the near future
    13·1 answer
  • .Statements using the ___________ class are explicit conversions.
    8·1 answer
  • Which of the following statements is true?
    5·1 answer
  • A city planner is using simulation software to study crowd flow out of a large arena after an event has ended. The arena is loca
    15·1 answer
  • Which of the following are input devices? Check all that apply.
    9·2 answers
  • 1. Identify a local or regional cause or issue for Social Change related to specific professional tracks that can be addressed o
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!