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

Calculate the total price for a computer kit that consists of a standard base co

ID: 648647 • Letter: C

Question

Calculate the total price for a computer kit that consists of a standard base configuration with options for RAM size (8, 12, or 16 GB), disk drive size (500, 1000,or 1500 GB) and monitor size (17, 22, or 26 inch diagonal). There is a price for the base configuration, to which must be added the prices for selected RAM, disk, and monitor. The kit is assembled in response to a customer order indicating the customer's choices of RAM, disc, and monitor.

(This requirement specification is actually incomplete, as it does not specify the base price or any of the prices of the optional components. Choose some reasonable specific values for all these component prices, and use them in your program.)

There are 5 components of your submission including:

Program Description - A concise, clear description of the program you are building.

Analysis - Address each of the following items:

What are the inputs? What is the data type of each input?

What are the outputs? What is the data type of each output?

Describe in detail how the program will get from the inputs to the outputs.

Provide a variables table, showing the name (as used in the program), the data type, and the usage of each variable used in the program

Test plan - Prepare at least 2 sets of input data (Test data) along with their expected output for testing your program. Present your test data in the form of a table such as shown below.

Flowchart - Provide a flowchart for your design. You can use Word, Powerpoint, Visio or any software you have available that will allow you to draw shapes and connectors. Even a scanned copy of a neat hand sketch would be acceptable if clear and legible.

Pseudocode- Provide pseudocode for your design.

Explanation / Answer

/*I would like to do this program in a simple java program*/
import java.io.*;

public class InputTest {
    public static void main(String[] args) {
        String[] lines = new String[0];
        String path = "input.txt";
        BufferedReader br = null;
        try {
            File file = new File(path);
            br = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
            String line;
            while( (line = br.readLine()) != null ) {
                lines = add(line, lines);
            }
            br.close();
        } catch(IOException e) {
            System.out.println("read error: " + e.getMessage());
        }
        print(lines);
    }

    private static String[] add(String s, String[] array) {
        int len = array.length;
        String[] temp = new String[len+1];
        System.arraycopy(array, 0, temp, 0, len);
        temp[len] = s;
        return temp;
    }

    private static void print(String[] data) {
        for(int i = 0; i < data.length; i++)
            System.out.println(data[i]);
    }
}

____________________________________________________________
OUTPUT
____________________________________________________________
RENTAL ITEMS               FEE(In $)
____________________________________________________________
           LAPTOP
-> Apple(4GB,13.3" Display)       $99
-> hp(4GB,15.6" Display)       $399.99
-> lenovo(4GB,11.6" Display)       $549.99
-> TOSHIBA(4GB,15.6" Display)       $199.99
-> ASUS(8GB,13.3" Display)       $599.99
-> ACER(4GB,15.6" Display)       $489.99
____________________________________________________________

/* input is datas that are provided in input.txt file format*/
/* output will be datas entered in .text file*/

__________________________________________________________

While considering with C/C++

FLOWCHART

__________________________________________________________

Input : cost of RAM ,MONITOR and HARDDISK for each computer kit.

datatype(input) for each cost in float(floating point)

Output: output will be in total (sum all values of RAM, MONITOR and HARDDISK)

datatype(output) : float

____________________________________________________________

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