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
shtirl [24]
2 years ago
5

Create a program that calculates the tip and total for a meal at a restaurant. Type the code into an IDLE IDE editor window and

save the finished code as a .py source code file. Remember that the text output from the IDLE shell window will be saved to a Word document.
Computers and Technology
1 answer:
Nataly [62]2 years ago
4 0

Missing details:

The formula for calculating the tip amount is:

tip = cost of meal * (tip percent / 100)

  • The program should accept decimal entries like 52.31 and 15.5.
  • Assume the user will enter valid data.
  • The program should round the results to a maximum of two decimal places.

Answer:

In Python:

print("Tip Calculator")

cost_meal =  float(input("Enter Cost of Meal: "))

tip_percent = float(input("Enter Tip Percent: "))

tip_amount = cost_meal * tip_percent / 100

total_amount = tip_amount + cost_meal

print("Tip amount:   "+str(round(tip_amount,2)))

print("Total amount:   "+str(round(total_amount,2)))  

Explanation:

This line prints the string "Tip "Calculator"

print("Tip Calculator")

This lime prompts user for cost of meal

cost_meal =  float(input("Enter Cost of Meal: "))

This lime prompts user for tip percemtage

tip_percent = float(input("Enter Tip Percent: "))

This line calculates the tip amount

tip_amount = cost_meal * tip_percent / 100

This line calculates the total amount

total_amount = tip_amount + cost_meal

This line prints the tip amount

print("Tip amount:   "+str(round(tip_amount,2)))

This line prints the total amount

print("Total amount:   "+str(round(total_amount,2)))  

Follow these steps to complete the solution

  • <em>Copy the code in the answer section.</em>
  • <em>Save as .py</em>
  • <em>Run the program</em>
  • <em>Save the screenshots of the program result in a word document</em>
You might be interested in
Information flows:
Anna11 [10]

Answer:

e.

Explanation:

Information flow refers to the back and forth movement of information between different people and systems in order to communicate and perform different decision making processes. Information flows between and among supply and other internal functions and external sources. Information flow is used in just about everywhere in the world.

6 0
3 years ago
Problem 1: you must write a method for this problem called sentenceAnalyzer Write a program that reads a sentence from the keybo
forsale [732]

Answer:

   static void sentenceAnalyzer(String sentence){

       int lenOfString = sentence.length()-1;

   

           if(sentence.charAt(lenOfString)=='.'){

               System.out.println("Declarative");

             

           }

           else   if(sentence.charAt(lenOfString)=='?'){

               System.out.println("Interrogative");

             

           }

           else if(sentence.charAt(lenOfString)=='!'){

               System.out.println("Exclamation");

             

           }

           else{

               System.out.println("Unknown");

             

           }

   

   }

Explanation:

Using Java programming language

Create the method as required

Obtain the index of the last element using the string length method

Use if and else statements to check if the character at the last index is equal to any of the characters given and print the expected output

see a complete code with the main method below

<em>import java.util.Scanner;</em>

<em>public class num11 {</em>

<em>    public static void main(String[] args) {</em>

<em>        Scanner in = new Scanner(System.in);</em>

<em>        //Receiving User input</em>

<em>        System.out.println("Enter a sentence");</em>

<em>        String sentence = in.nextLine();</em>

<em>        // Calling the method</em>

<em>        sentenceAnalyzer(sentence);</em>

<em>    }</em>

<em>    static void sentenceAnalyzer(String sentence){</em>

<em>        int lenOfString = sentence.length()-1;</em>

<em />

<em>            if(sentence.charAt(lenOfString)=='.'){</em>

<em>                System.out.println("Declarative");</em>

<em>            }</em>

<em>            else   if(sentence.charAt(lenOfString)=='?'){</em>

<em>                System.out.println("Interrogative");</em>

<em>            }</em>

<em>            else if(sentence.charAt(lenOfString)=='!'){</em>

<em>                System.out.println("Exclamation");</em>

<em>            }</em>

<em>            else{</em>

<em>                System.out.println("Unknown");</em>

<em>            }</em>

<em>    }</em>

<em>}</em>

<em />

8 0
3 years ago
What development first helped people shape their communities through<br> informed decisions?
uranmaximum [27]

Answer:

The development of a simplified alphabet.

Explanation:

3 0
3 years ago
Consider a file system that uses inodes to represent files. Disk blocks are 2KB in size and a pointer to a disk block requires 4
deff fn [24]

Answer:

a.  Maximum size of file = 8.003 GB

Explanation:

<u>a. Maximum size of file</u>

= (6 * 2 KB) + (2048 * 2 KB) + (2048 * 2048 * 2 KB)

= 12kb + 4096 Kb +  8388608 kb

= 8392716 kb

8392716/1024 mb = 8196.01 MB

8196.01 /1024 GB= 8.003 GB

<u>b. According to above calculation</u>

For 8 GB 6 direct, 1 single and 1 double indirect block requires

so

for 32 GB

24 direct Block

4 single and 4 double indirect block requires

7 0
3 years ago
// PrintStrings // Traverse the 2D character array "strings" and print each of the contained strings.// See the example outputs
anzhelika [568]

Answer:

C++.

Explanation:

void printStrings(char strings[NUM_STRINGS][STRING_LENGTH]) {

   // Multi dimension array can be traversed through multi-level loops

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

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

           cout<<"<<strings[i][j]<<";

       }

       cout<<endl;

   }

}

Output would be like this, depending on the size of NUM_STRINGS;

"One"

"Two"

"Three"

....

6 0
3 years ago
Other questions:
  • Technology progresses so new needs can be satisfied.<br><br> A. true<br><br> B. false
    12·2 answers
  • Although highly accurate navigational information from the GPS constellation is exploitable by adversary forces, it is unlikely
    5·1 answer
  • Write the definition of a function named quadratic that receives three double parameters a, b, c. If the value of a is 0 then th
    12·1 answer
  • Is a psychrometer more likely used at a beach or a desert in California
    12·1 answer
  • A vacuum tube that contains a grid can be classified as a A. rectifier B. triode C. pentode D. diode
    12·1 answer
  • Write assembly programs with the following I/O
    15·1 answer
  • 7. Which cipher is based on the clues of the physical factors, rather than the hardware or a software cryptosystem
    8·1 answer
  • Where in PowerPoint should a user navigate to complete the tasks listed below?
    6·1 answer
  • Explica el empleo de cuentas y contraseñas en archivos
    6·1 answer
  • Using complete sentences post a detailed response to the following.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!