Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please follow the porfessor detailed instructions in the order of the pictures Formatting Output (FreshFormat.java $5.25 per pound and 41 ounces). Use the formatting object

please follow the porfessor detailed instructions in the order of the pictures image text in transcribed
image text in transcribed
image text in transcribed
Formatting Output (FreshFormat.java $5.25 per pound and 41 ounces). Use the formatting object money to print the unit price and total price and the formatting object fint to print the weight to 2 decimal places. The Best Fresh Market Unit Price: $5.25 per pound Weight: 2.56 pounds TOTAL: $13.45 Total possible points: 14 points: a) Tasks 2, 3, and 4: 2 points each (Subtotal: 6) b) Tasks 5 and 6: 4 points each (Subtotal: 8) public class EreshFormat 1 // 1/ main reads in the price per pound of a fresh vegetable 1/ and number of ounces of and then computes 1/ the total price and prints a "label" for the item 1/ public static void main (String[] args) i final double OUNCES_PER_POUND =16.0; double pricePerPound; - // price per pound double weightounces; /I weight in ounces double weight; // weight in pounds double totalprice; /1 total price for the vegetable Scanner scan = new Scanner (System. in) ; I/ Declare moneyFormat as a NumberFormat object and use the // getcurrencyinstance method to assign it a value // Declare decimalfmt as a Decimalformat object and instantiate ll it to format numbers with at least one digit to the left of the /f decimal and the fractional part rounded to two digits. // prompt the user and read in each input

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

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

Students also viewed these Databases questions