Question: pseudocode ( changes in blue ) start main ( Strings args [ ] ) set militia = 0 set totSalaries = 0 loop start: while
pseudocode changes in blue
start mainStrings args
set militia
set totSalaries
loop start:
while names in args
get input for name base salary variable
Select
if mercenary name Kalinga can used name constant or literal constant, comment in your code which constant type you are using then shackle and imprison,
else continue to add mercenary to militia
set militia militia
set totSalaries totSalaries salary
maxpercent calcmaxpercentsalary
percent simulatenegpercentmaxpercent
negsalary calcnegsalarysalary percent
output your mercenary name and your contract values salary, negotiated salary and loot.
input number of months in battle
input Solidus loot value
input side a value of triangulated territory border to conquer
input side b value of triangulated territory border to conquer
input side c value of triangulated territory border to conquer
soliduspay calcpaynegsalary, months, percent, loot
calcdisplaysolidusdiffnegsalary, salary, months, percent, loot
angleA calcanglesidea sideb, sidec
angleb calcanglesideb sidea, sidec
anglec calcanglesidec sidea, sideb
Output formatted to decimal places side a side b side c and angle A angle B Angle C
end loop
Output battle cry, size of militia and total salaries committed by the empire for battle!
Output "UUKHAI!"
end main
method definitions
outside main but in class
double calcmaxpercents
s maxpercent
s maxpercent
s maxpercent
s maxpercent
s maxpercent
return maxpercent
double simulatenegpercentmaxpercent
return random number from range between maxpercent
double calcnegsalarysalary percent
return salary salary percent
double calcpaynegsalary, months, percent, loot
return negsalary x months loot x percent
void calcdisplaysolidusdiffnegsalary, salary, months, percent, loot
Calculate mercenary pay if was salary and loot
Calculate mercenary pay if salary and loot
Calculate difference between mercenary pay and salary
Calculate difference between mercenary pay and loot
Output formatted to decimal places mercenary actual pay in Solidus, what it would have been if salary, and the difference
Output formatted to decimal places mercenary actual pay in Solidus, what it would have been if loot, and the difference
double calcangleabc
Calculate angle territory border
return angle
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
