ET 2.1 Salary Scheme

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Salary Scheme

Enabling Task 2.1


ICT 10
ICT
Salary Scheme
Grade 10 Realino

Submitted by:
Zechariah Iziel Culanag
Brand Noah Aquino
Stanislaus Plunket
Josh Daryll Estomago

Submitted to:
Ms. Carmela Fe Acuyan
Table Of Contents

- Program Design
Part 1
allenge
Introduction to the Ch
, Flow cha rt, Pseud ocode
Algorithm

Part 2 - Challenge
Raw codes
Running codes
Reflection
PART 1
ALgorithm
Salary Scheme A

Step 1: Start.
Step 2: Declare variables a1, an, r, n, sn
Let a1 be starting amount
let an be amout to have
let r be percentage of increase
let n be how many years
let sn be total amount of salary

Step 3: Input with formula an=a1(1-r^n)


Step 4: a5=150,000(2^5-1)
a5=2,400,000

Step 5: input with formula sn=a1(1-r^n)/1-r


Step 6: s5=150,000(1-2^5)/1-2
Step 7: s5 = 4,650,000
Step 8: End
ALgorithm
Salary Scheme B

Step 1: Start.
Step 2: Declare variables a1, an, r, n, sn
Let a1 be starting amount
let an be amout to have
let r be percentage of increase
let n be how many years
let sn be total amount of salary

Step 3: Input with formula an=a1(1-r^n)


Step 4: a5=250,000(2^5-1)
a5=4,000,000

Step 5: input with formula sn=a1(1-r^n)/1-r


Step 6: s5=250,000(1-2^5)/1-2
Step 7: s5 = 7,750,000

Step 8: End
Flowchart - A
START
Declare variables

an, a1, r, n, Sn

Input with formula

an=a1(1-r^n)

a5=150,000(2^5-1)
a5=2,400,000

input with formula

sn=a1(1-r^n)/1-r

s5=150,000(1-

2^5)/1-2

s5=4,650,000

END
Flowchart - B
START
Declare variables

an, a1, r, n, Sn

Input with formula

an=a1(1-r^n)

a5=250,000(2^5-1)
a5=4,000,000

input with formula

sn=a1(1-r^n)/1-r

s5=250,000(1-

2^5)/1-2

s5=7,750,000

END
Pseudocode!
Program START
Input category
Input amount
Initialize category and amount
Display Year salary + value
Display Partial salary + value
Display Monthly salary + value
Display Yearly rate of increase + value
Display Common Ratio+ value
Print
Input 5th year salary + value
Input Sum of salary in 5 years + value
Print
END Program
PART 2
Raw COdes
import java.util.Scanner;
import java.util.ArrayList;

public class Main {


public static void main(String[] args) {

ArrayList<Double> scheme1 = new ArrayList<>();


ArrayList<Double> scheme2 = new ArrayList<>();
Scanner scan_obj = new Scanner(System.in);

//Inputs
System.out.println("Please enter the yearly salary of

Scheme1: ");
scheme1.add(scan_obj.nextDouble());

System.out.println("By how much percent does this

salary increase yearly?");


double s1_percent = ((scan_obj.nextDouble() / 100) +

1);

System.out.println("Please enter the yearly salary of

Scheme2: ");
scheme2.add(scan_obj.nextDouble());

System.out.println("By how much percent does this

salary increase yearly?");


double s2_percent = ((scan_obj.nextDouble() / 100) +

1);
Raw COdes
//Computations
double s1_total = 0;

for (int i = 0; i < 5; i++) {


if (i == 0) {
s1_total += scheme1.get(i);
continue;
}
scheme1.add((scheme1.get(i - 1) * s1_percent));
scheme1.set(i, Math.round(scheme1.get(i) * 100.0) / 100.0);
s1_total += scheme1.get(i);
}
s1_total = Math.round(s1_total * 100.0) / 100.0;

double s2_total = 0;

for (int i = 0; i < 5; i++) {


if (i == 0) {
s2_total += scheme2.get(i);
continue;
}
scheme2.add((scheme2.get(i - 1) * s2_percent));
scheme2.set(i, Math.round(scheme2.get(i) * 100.0) / 100.0);
s2_total += scheme2.get(i);
}
s2_total = Math.round(s2_total * 100.0) / 100.0;}
Raw COdes
//Printing the findings
System.out.println("\nSalary Scheme 1 earnings per year:");

for (int i = 0; i < 5; i++) {


System.out.println(" Year " + (i + 1) + ": " + scheme1.get(i));
}
System.out.println("Total: " + s1_total);

System.out.println("\nSalary Scheme 2 earnings per year:");

for (int i = 0; i < 5; i++) {


System.out.println(" Year " + (i + 1) + ": " + scheme2.get(i));
}
System.out.println("Total: " + s2_total);

//Conclusion
System.out.println("\nConclusion:");
if (s1_total > s2_total) {
System.out.println("Salary Scheme 1 is superior.");
} else if (s2_total > s1_total){
System.out.println("Salary Scheme 2 is superior.");
} else {
System.out.println("The two schemes are equal.");
}
}
}
Running
Codes
Reflection!
How did this activity give an

effect to you?

These tasks that enabled us to better

understand and develop our coidng talents. In

order for our codes to function, this gave us

the chance to think critically and precisely.

This demonstrates to us how easily math

problems can be solved using coding, which

makes it much easier to find solutions to

issues. Because we can't copy other people's

codes, this task made us realize how difficult

coding is even more because we have to learn

it by heart. We struggle with this enabling

work because of our mediocre ICT skills and

other obligations, like the Christmas fair.


full photos of the codes
full photos of the codes

You might also like