our goal is to solve the following simple programming exercise. You have been as
ID: 3660100 • Letter: O
Question
our goal is to solve the following simple programming exercise. You have been asked by your accounting department to design an algorithm determining the annual profit for your company. The algorithm should ask the user for the projected monthly sales for 12 months. Then, you need to determine the annual profit and display it to the user. The annual profit is 21% of the total sales. Part A: Using Visual Logic, write the monthly sales amounts to a file, monthly_Sales.dat. (Hint: be sure to enter a sentinel value for end of file processing later.) Part B: Using a separate algorithm, use the monthly_Sales.dat file as input to determine the companyExplanation / Answer
Part A
---------
Start
Declare variable i as integer
for i=1 to 10 do
display i*i
end for
Stop
No need for inputting from the user, in this algorithm, just printing the squares of numbers 1 to 10 using a FOR loop
Part B
--------
Start
Declare variable i as integer
set i=1
while i<=10
display i*i
i=i+1
end While
Stop
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.