Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MIST 3050 Business Applications Development Homework: College Discount Rate (Arr

ID: 3907733 • Letter: M

Question

MIST 3050 Business Applications Development Homework: College Discount Rate (Array. Control Structure) You are encouraged to form a team of 2 or 3 to work on this homework. Each team submits only one copy of the homework. Submit your homework on Blackboard before the deadline. No late homework is accepted. In this homework, you will re-implement the program that tabulates the sticker price, net price, and discount rate of selected Massachusetts colleges listed in P.20 of the text. Discount rate is defined as Discount Rate-1Net Price Sticker Price When tabulating the data, you will mark the colleges with a discount rate in the range of 50%, 60% with *, and colleges with a discount rate greater than 60% with **. Thus your output will be similar to the following table. Sticker Price Net Price % Discount Rate $17,574 $18,277 College Amherst College* Harvard University Hellenic College-Holy Cros5* Massachusetts Institute of Technology Saint John's Seminary** Wellesley College Williams College** Average $40,862 $38,415 $6,738 $19,503 $39,212 57 52 65 47 $20,660 $13,750 $39,666 $41,434 $33,263 $2,650 $18,400 $16,493 $14,399 81 54 60 60 Note: "Average should not be marked with asterisks. Implementation Requirement Your implementation must use a 1-D array of Stringt] type to store colleage names, and a 2-D array of double[)[) type to store sticker price and net price. In addition, the program must include hree methods with the following specified signatures: . void main(String[) args). Declares and initializes variables; calls the other two methods; computes the averages. Note: you must use a loop to iterate through the arrays.

Explanation / Answer

import java.util.*;
public class MyClass {
    public static void main(String args[]) {
        String c_name[] = new String[100];
        double[][] price=new double[100][2];
        int n,i,j;
        float disc[]=new float[100];
        System.out.println("Enter number of Colleges");
        Scanner sc = new Scanner(System.in);
        n=sc.nextInt();
        for(i=0;i<n;i++){
            c_name[i] = sc.nextLine();
            sc.next();
            for(j=0;j<2;j++){
                price[i][j]=sc.nextDouble();
            }
            disc[i] = (float)(1 - (price[i][1]/price[i][0]))*100;
        }
        for(i=0;i<n;i++){
            if(disc[i]=>50&&disc[i]<60){
                c_name[i]+="*";
            }
            else if(disc[i]=>60){
                c_name[i]+="**";
            }
            System.out.printf("%50s",c_name[i]);
            System.out.printf("%10f",price[i][0]);
            System.out.printf("%10f",price[i][1]);
          
        }
    }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote