There are 2 versions. Label each .java file with basic and intermediate.For this assignment there are two versions of the java script files I'll need. Each one builds off the previous starting with...

1 answer below »
There are 2 versions. Label each .java file with basic and intermediate.For this assignment there are two versions of the java script files I'll need. Each one builds off the previous starting with basic, then intermediate. This has to be through Eclipse Java, so if I copy and paste into java it'll run correctly. I'll upload the instructions for each part (basic, intermediate). The methods used in this assignment should be pretty basic because this is an intro to computer science class.



Inventory Intermediate version If you complete this version correctly, you will receive up to a 89% (B) Complete (and submit) the basic version first. Then, create a new version adding the following to basic version: The input file will have 2 new items at the end of each line: sold – The number of these items sold in past month minimum – the level of inventory at which the item should be restocked (buy more from your vendor) Output this new data in columns in the output file, along with new columns called “profit” and “left” Write a method to determine profit, sending the method the values of cost, price, and sold. It should return the amount of profit made. The “left” column should be the (quantity – sold), that is the number of items left in inventory. Create a new output file named “reorder.txt”. It will have listed the items whose left amount is <= the target amount. include the name, quantity, sold, target and left amounts. it, too, should be formatted in tabular form with a title row. summary data should also include total profit and # of items to be reordered. sample input file: thingy 22 15.65 45.00 8 10 whatchacallit 59 67.99 25.5 35 30 gizmo 10 100.00 40.00 2 9 should produce an output file: item quantity cost (w) markup % price(r) value (w) value (r) sold target profit left -------------------------------------------------------------------------------------------------------------------- thingy 22 15.65 45.00 22.69 344.30 499.24 8 10 56.34 14 whatchacallit 59 67.99 25.50 85.33 4011.41 5034.32 35 30 606.81 24 gizmo 10 100.00 40.00 140.00 1000.00 1400.00 2 9 80.00 8 and a reorder file: item quantity sold target left ----------------------------------------------------- whatchacallit 59 35 30 24 gizmo 10 2 9 8 and summary data: total value of all items: wholesale: $5355.71 retail: $6933.55 # of different items: 3 total # of items: 91 total profit: $743.15 # of items needing reorder: 2 the="" target="" amount.="" include="" the="" name,="" quantity,="" sold,="" target="" and="" left="" amounts.="" it,="" too,="" should="" be="" formatted="" in="" tabular="" form="" with="" a="" title="" row.="" summary="" data="" should="" also="" include="" total="" profit="" and="" #="" of="" items="" to="" be="" reordered.="" sample="" input="" file:="" thingy="" 22="" 15.65="" 45.00="" 8="" 10="" whatchacallit="" 59="" 67.99="" 25.5="" 35="" 30="" gizmo="" 10="" 100.00="" 40.00="" 2="" 9="" should="" produce="" an="" output="" file:="" item="" quantity="" cost="" (w)="" markup="" %="" price(r)="" value="" (w)="" value="" (r)="" sold="" target="" profit="" left="" --------------------------------------------------------------------------------------------------------------------="" thingy="" 22="" 15.65="" 45.00="" 22.69="" 344.30="" 499.24="" 8="" 10="" 56.34="" 14="" whatchacallit="" 59="" 67.99="" 25.50="" 85.33="" 4011.41="" 5034.32="" 35="" 30="" 606.81="" 24="" gizmo="" 10="" 100.00="" 40.00="" 140.00="" 1000.00="" 1400.00="" 2="" 9="" 80.00="" 8="" and="" a="" reorder="" file:="" item="" quantity="" sold="" target="" left="" -----------------------------------------------------="" whatchacallit="" 59="" 35="" 30="" 24="" gizmo="" 10="" 2="" 9="" 8="" and="" summary="" data:="" total="" value="" of="" all="" items:="" wholesale:="" $5355.71="" retail:="" $6933.55="" #="" of="" different="" items:="" 3="" total="" #="" of="" items:="" 91="" total="" profit:="" $743.15="" #="" of="" items="" needing="" reorder:="">
Answered Same DayDec 05, 2021

Answer To: There are 2 versions. Label each .java file with basic and intermediate.For this assignment there...

Arun Shankar answered on Dec 09 2021
149 Votes
import java.io.File;
import java.io.FileWriter;
import java.util.Scanner;
public class Basic
{

    
    public static double round_off(double arg)
    {
        arg *= 100;
        arg = (int) Math.ceil(arg);
        return arg/100;
    }
    
    public static void main(String[] args)
    {
        try
        {
            int qty=0, count=0, num_items=0;
            double cost=0, markup=0, price=0, value_w=0, value_r=0;
            
            double sum_valuew=0, sum_valuer=0;
            
            Scanner scanner = new Scanner(new File("src/input.txt"));
            FileWriter fw = new FileWriter("src/testout.txt");
            
            // Write header in the output file
            fw.write("Item\tQuantity\tCost (W)\tMarkup %\tPrice(R)\tValue (W)\tValue...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here