Case Study Solution

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

1

Case Study # 1
In this case study, you apply the software development procedure.

Case Study Solution


Step 1: Analyze the Problem

When performing the expressions, the variables are x and y. The input
values are whatever the user decides to use as a replacement for the
variables. Output will be the final answer after the new equation is
calculated.

Step 2: Develop a Solution

Start Program

Input becomes x and y

Take the value and put in equation

Display results

End Program

Hand Calculation:

x=8

y=12

x+y=20

Step 3: Code the Solution

public class consleApp {


2

static viod main(String [] args) {

//Assign a value to x and y

int x, y;

x= userInputX;

y= userInputY;

x+y

x–y

y-x

x*y

x/y

y/x

x(x-1)/2

y(y-1)/2

x(x-1)/2 - y(y-1)/2

x * y / y + x / (y – x)

system.out.println("Answer : " )
3

Step 4: Test and Correct the Program

**Screenshot should have your header and output values visible**

You might also like