Question 03) Write a Java program that prompts the user to enter the weight of a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Question 03) Write a Java program that prompts the user to enter the weight of a person in kilograms and outputs the equivalent weight in pounds. Output both the weights rounded to two decimal places. (Note that 1 kilogram = 2.2 pounds.) Format your output with two decimal places. [Hint: Use the System.out.printf method] Question 04) A cinema owner decides to donate a portion of their income to a local charity for each movie. Create a console Java program to calculate the amount to be donated to charity. Your program should use inputData.txt file to input the following: 1) The movie name, 2) The ticket price, 3) The number of tickets sold, and 4) The percentage to be donated. inputData.txt Titanic 14 250 7.50 The program should compute the amount to be donated. After that your program should store the output in "donations.txt" file as well as display the output on the console as shown below: Movie: Titanic Total Sales: £3500.00 Total Donations: £262.50 Question 03) Write a Java program that prompts the user to enter the weight of a person in kilograms and outputs the equivalent weight in pounds. Output both the weights rounded to two decimal places. (Note that 1 kilogram = 2.2 pounds.) Format your output with two decimal places. [Hint: Use the System.out.printf method] Question 04) A cinema owner decides to donate a portion of their income to a local charity for each movie. Create a console Java program to calculate the amount to be donated to charity. Your program should use inputData.txt file to input the following: 1) The movie name, 2) The ticket price, 3) The number of tickets sold, and 4) The percentage to be donated. inputData.txt Titanic 14 250 7.50 The program should compute the amount to be donated. After that your program should store the output in "donations.txt" file as well as display the output on the console as shown below: Movie: Titanic Total Sales: £3500.00 Total Donations: £262.50
Expert Answer:
Answer rating: 100% (QA)
Question 03 java import javautilScanner public class WeightConverter public static void mainString a... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
On January 1, 20X5, Malhotra Imports purchased a warehouse for $750,000. Malhotra paid $150,000 in cash and financed the remaining amount with a 15-year, 8% mortgage with monthly payments of $5,734...
-
31% of American adults surveyed stated that giving up their phone for a day would be more difficult than giving up their significant other. In 2012, the United States population over the age of 18...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
For each polynomial function, find (a) (-1), (b) (2), and (c) (0). f(x) = x + 2x - 8
-
The Yerkes refracting telescope has a 1.00-m diameter objective lens of focal length 20.0 m. Assume it is used with an eyepiece of focal length 2.50 cm. (a) Determine the magnification of the planet...
-
Stan Moneymaker presently owns a 10-year-old automobile with low mileage (78,000 miles). The NADA "blue book" value of the car is $2,500. Unfortunately, the car's transmission just failed, and Stan...
-
Determine the elongation of the square hollow bar when it is subjected to the axial force P = 100 kN. If this force is increased to P = 360 kN and released, find the permanent elongation of the bar....
-
On January 6, Petro Co. sells merchandise on account to Chose Inc. for $9,200, terms 1/10, n/30. On January 16, Chose pays the amount due. Instructions Prepare the entries on Petro Co.s books to...
-
Find f'(x) and find the equation of the line tangent to the graph of f at x = 1. f(x)=(1+4x)(5-4x) f'(x)=
-
National Bank operates a network of automated teller machines (ATMs). Cash withdrawals at an ATM aver-age about $ 80. The bank estimates that the fixed cost of filling an ATM with cash is about $ 100...
-
You have been prequalified for a unique 20 year monthly payment mortgage loan at 3.096% annual interest rate compounded monthly. You were prequalified on the basis of making a $2050 payment per month...
-
Create a COBOL program that will create two input files, one for BSCS and one for BSIT students with the following record description: STUDENT NUMBER: 10 characters STUDENT NAME: COURSE CODE: GRADE...
-
A steel tube (E = 200 GPa) with a 32-mm outer diameter and a 4-mm wall thickness is placed in a vise, which is adjusted so that its jaws just touch the ends of the tube without exerting pressure on...
-
6. Use Tesla's information below to answer this question: Tesla Inc (TSLA) 2/27/23 Stock P = 207.63 Call 30.40 Strike Price Days Put 185 32 6.90 190 32 26.90 8.45 195 32 23.70 10.15 185 53 35.25...
-
A first-order reaction has a half-life of 2.2 h. If the initial concentration is 132 nM, how long will it take for the concentration to fall to 84 nM? Give your answer in h to two decimal places. You...
-
A calendar year taxpayer, made one asset purchase during the year and will not use section 179 or bonus. The asset is 7 year recovery period property that was placed in early october. how many months...
-
From the following taken out from the books of Suresh & co. You are required to prepare Trading and Profit& Loss account and Balance Sheet as at 31.12.2019. Particulars Dr. Rs. Sundry Debtors...
-
Draw and label the E and Z isomers for each of the following compounds: 1. CH3CH2CH==CHCH3 2. 3. 4. CH,CH2C CHCH2CH Cl CH3CH2CH2CH2 CH CH2CCCH2CI CHCH3 CH3 HOCH CH CCC CH O-CH C(CH
-
(Approximate ?) ? can be computed using the following formula: Write a program that displays the result of 4 ? Use 1.0 instead of 1 in your program. T = 4 x 1 3 11 and 4 x (1 11 11 13
-
Coupon collector is a classic statistics problem with many practical applications. The problem is to pick objects from a set of objects repeatedly and find out how many picks are needed for all the...
-
Write a program that prompts the user to enter the minutes (e.g., 1 billion), and displays the number of years and days for the minutes. For simplicity, assume a year has 365 days. Here is a sample...
-
Consider a stochastic process such that the underlying security \(S\) follows the model: \[d S_{t}=\mu S_{t} d t+\sigma_{t} S_{t} d Z_{t}\] where \(Z\) is a standard Brownian motion. Suppose the...
-
Calculate the solution to the following SDE: \[d X_{t}=\alpha\left(m-X_{t} ight) d t+\sigma d B_{t}\] with \(X_{0}=x\). The process satisfying this equation is called the meanreverting...
-
If \(X_{t} \sim N\left(0, \sigma^{2} t ight)\) and \(Y_{t}=e^{X_{t}}\), calculate the pdf of \(Y_{t}\). Calculate \(\mathbf{E}\left[Y_{t} ight]\) and \(V\left(Y_{t} ight)\). Calculate the transition...
Study smarter with the SolutionInn App