Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**Java Languge** 3- A cars miles-per-gallon (MPG) can be calculated with the following formula: MPG = Miles driven / Gallons of gas used Write a

**Java Languge**

3- A cars miles-per-gallon (MPG) can be calculated with the following formula:

MPG = Miles driven / Gallons of gas used

Write a program that asks the user for the number of miles driven and the gallons of gas used. It should calculate the cars miles-per-gallon and display the result on the screen.

4- Write a program that computes the tax and tip on a restaurant bill. The program should ask the user to enter the charge for the meal. The tax should be 6.75 percent of the meal charge. The tip should be 20 percent of the total after adding the tax. Display the meal charge, tax amount, tip amount, and total bill on the screen.

5- Write a program that asks the user to enter the name of his or her favorite city. Use a String variable to store the input. The program should display the following:

The number of characters in the city name

The name of the city in all uppercase letters

The name of the city in all lowercase letters

The first character in the name of the city

Submission guides:

  • Submit your code as a .java or .txt file for each question.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

I am paid fairly for the work I do.

Answered: 1 week ago

Question

Select suitable tools to analyze service problems.

Answered: 1 week ago