0% found this document useful (0 votes)
54 views

Assignment 5.1

This document contains 6 programming problems that involve manipulating and calculating values in multi-dimensional arrays. The problems include calculating an individual salary value, averaging salaries across different job grades, summing salaries by job grade, and displaying a pay scale table with a 3.5% increase. Loops and conditional statements are used to iterate through the arrays.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

Assignment 5.1

This document contains 6 programming problems that involve manipulating and calculating values in multi-dimensional arrays. The problems include calculating an individual salary value, averaging salaries across different job grades, summing salaries by job grade, and displaying a pay scale table with a 3.5% increase. Loops and conditional statements are used to iterate through the arrays.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Name: Florence Jean O.

Garcia Score:
Section: 2 CPE-A Date: September , 2020

ASSIGNMENT 5.1

Problem 1 Problem 2

START
START

Double[,] salary = {
{ 115, 215, 342.50, 510 }, Double[,] salary = {
{ 125, 232.50, 360, 620 }, { 115, 215, 342.50, 510 },
{ 145, 245, 380, 740 }, { 125, 232.50, 360, 620 },
{ 167.50, 267.05, 405, 850 }, { 190, { 145, 245, 380, 740 },
290, 440, 990 }}; { 167.50, 267.05, 405, 850 }, { 190,
290, 440, 990 }};

int row 5, col = 3;

Console.Writeline(“Skill Grade
1 Step 2\n\nDaily Rate:
${0}”,salary[2,1]); Console.Writeline(“Average pay of
Grade 3 programmers pay ${0}”);

END
Double avePayGrade3 = (salary[0,col]
+ salary[1, col] + salary[2, col] +
salary[3, col] + salary[4, col]) / 5;

END
Problem 3
START

Double[,] salary = {
{ 115, 215, 342.50, 510 },
{ 125, 232.50, 360, 620 },
{ 145, 245, 380, 740 },
{ 167.50, 267.05, 405, 850 }, { 190, 290,
440, 990 }};

Double[]averagePayGrades = new
double[4] ;

Y
E
S

int I = O; i < 4; i++


2 NO int i = 0; i < 5; i++ 1 NO
,
Y
E
YES \n NO
S

int j = O; j < 5; j++


int j = 0; < 4;j++ NO NO

Y
E
YES S

averagePayGrade[i]+= salary[j, i];


“${0,-10}”, salary[I, j]”

(“
Double averagePayGrade in
“) average PayGrades

YES NO

(“${0, -10}”,
averagePayGrade / 5

END
START
Problem 4

Double[,] salary = {
{ 115, 215, 342.50, 510 },
{ 125, 232.50, 360, 620 },
{ 145, 245, 380, 740 },
{ 167.50, 267.05, 405, 850 }, { 190, 290,
440, 990 }};

Double averagePayGrade = 0;

int i = 0; i < 5; i+ \n
NO
END 4 +

Y
E
S

int j = 0;j <


NO averagePayGrade = 0;
3 4; j++

Y
E
S

“${0,-10}”, salary[I, j]

averagePayGrade += salary[I, j]

j == 3
NO

YES

averagePayGrade/=4

“{0;F2”,
averagePaygrade 3
START
Problem 5
Double[,] salary = {
{ 115, 215, 342.50, 510 },
{ 125, 232.50, 360, 620 },
{ 145, 245, 380, 740 },
{ 167.50, 267.05, 405, 850 }, { 190, 290,
440, 990 };

Double[,] averagePayGrades = new


double [4];

int i = 0; <
NO 4; i++
END
5
YES
\n
NO

int j = 0;j < 5;


6 j+=4

YES

YES
J == 4 +

YES

averagePayGrade[i] += salary [j,i];


-

averagePayGrades[i] += salary[j,i] “{0,-5}”, salary [j, i];

6
j == 4

“ = {0}, {averagePayGrade[i]*-1

Problem 6 START
Double[,] salary = {
{ 115, 215, 342.50, 510 },
{ 125, 232.50, 360, 620 },
{ 145, 245, 380, 740 },
{ 167.50, 267.05, 405, 850 },
{ 190, 290, 440, 990 }};

7 “\nPay Scale Table\n”

\n

int i = 0;I < 5; i++


NO

YES

int j = 0; j < 4; j++

YES

“${0,-10}”, salary[I, j]

“\nPay Scale Table with


3.5% INCREASE\n”

END int i =0; < 5; i+


8 +;

int j = 0; j
YES < 4; j++ NO
\n

YES

“${0,-10}”, (salary[I,
j]*0.035)
10
Problem 7 START
“\n\nCurrent Daily Rate: ${0}\n”,
salary[stepRow, payGradeCol]

“-----------------\n\nIncrease When
Promoted to: \n”
Double[,] salary = {
int i = stepRow, I
< 5; i++ NO

YES
END
\n
payGrad YES
eCol != 3
NO “\nSTEP;
{0}\n,i

NO

Int j =
!int.TryParse
(Console.ReadLine (),
payGradeC
out PayGradeCol) II ol; j < 4; j++
payGradeCol > 3 II
payGradeCol < 0

YES YES

YES

(salary[I, j]) ==
Whole Numbers 0-3 are
currentPayGra
Allowed
de

NO

Enter Stop
NO

“\nPayGrade [0]:Current Daily


Rate + ${1,-10} Future Daily Rate
!int.TryParse
$[2]”,j, (salary[I,j]) –
(Console.ReadLine (),
currentPayGrade, salary [I,j]
out payGradeCol) II
payGradeCol < 0

YES

NO
Whole Numbers 0-3
are allowed

currentPayGrade =
11
salary[stepRow,
Problem 8 START
payGradeCol];
“\n\nCurrent Daily Rate: ${0}\n”,
salary[stepRow, payGradeCol]

10 “-----------------\n\nIncrease When
Promoted to: \n”
Double[,] salary = {
int i = stepRow, I
< 5; i++ NO 12

YES
END
\n
payGrad YES
eCol != 3
NO “\nSTEP;
{0}\n,i

NO

Int j =
!int.TryParse
(Console.ReadLine (),
payGradeC
out PayGradeCol) II ol; j < 4; j++
payGradeCol > 3 II
payGradeCol < 0

YES YES

YES dailyRateIncreased =
salary[i,j] +
Whole Numbers 0-3 are (salary[i,j]*0.035);
Allowed

NO

Enter Stop
dailyRateIncre
ased ==
currentPayGra
de

!int.TryParse
(Console.ReadLine (),
out payGradeCol) II NO
payGradeCol < 0

“\nPayGrade [0]:Current Daily


YES Rate + ${1,-10} Future Daily Rate
$[2]”,j, (salary[I,j]) –
NO
Whole Numbers 0-3 currentPayGrade, salary [I,j]
are allowed

currentPayGrade =
13
(salary[stepRow,
Problem 9 START
payGradeCol];*0.035)
“\n\nCurrent Daily Rate: ${0}\n”,
salary[stepRow, payGradeCol]

11 “-----------------\n\nIncrease When
Promoted to: \n”
Double[,] salary = {
int i = stepRow, I
< 5; i++ NO 14

YES
END
\n
payGrad YES
eCol != 3
NO “\nSTEP;
{0}\n,i

NO

Int j =
!int.TryParse
(Console.ReadLine (),
payGradeC
out PayGradeCol) II ol; j < 4; j++
payGradeCol > 3 II
payGradeCol < 0

YES YES

YES

(salary[I, j]) ==
Whole Numbers 0-3 are
currentPayGra
Allowed
de

NO

Enter Stop
NO

“\nPayGrade [0]:Current Daily


Rate + ${1,-10} Future Daily Rate
!int.TryParse
$[2]”,j, (salary[I,j]) –
(Console.ReadLine (),
currentPayGrade, salary [I,j]
out payGradeCol) II
payGradeCol < 0

Problem 10. Problem 1-9 flowcharts are for

YES problem number 10


NO Whole Numbers 0-3
are allowed

currentPayGrade = (salary[stepRow,
payGradeCol]* 0.035)

13

You might also like