Algorithms Answers

Questions answered by Experts: 652

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

  1. Write an algorithm that will accept the following for 100 students: The students’ name (studName) and 3 test marks (marks), as well as one exam mark (examMark). The program must calculate the final mark (finMark) for every student. The final mark comprises of 50% of the exam mark added to 50% of the average (agv) of the 3 tests.

Display the final mark for every student.


1.1 Mix the for loop with a do-while


Do the necessary planning (IPO) and write an algorithm in pseudo code for the following:


  1. Write an algorithm that will accept the following for 100 students: The students’ name (studName) and 3 test marks (marks), as well as one exam mark (examMark). The program must calculate the final mark (finMark) for every student. The final mark comprises of 50% of the exam mark added to 50% of the average (agv) of the 3 tests.

Display the final mark for every student.


1.1 Use a nested for loop to determine the answer.


Do the necessary planning (IPO) and write an algorithm in pseudo code for the following:


Write an algorithm that will accept the following for 100 students: The students’ name (studName) and 3 test marks (marks), as well as one exam mark (examMark). The program must calculate the final mark (finMark) for every student. The final mark comprises of 50% of the exam mark added to 50% of the average (agv) of the 3 tests.

Display the final mark for every student.

1. Use a simple for-loop to determine the answer.


Write an algorithm to allow users to enter a quantity of numbers until a negative number is entered. Then display the highest and lowest number entered.

  1. Use a do-loop-until to determine the answer.

Do the necessary planning (IPO) and write an algorithm in pseudo code for the following:

1. Write an algorithm to allow users to enter a quantity of numbers until a negative number is entered. Then display the highest and lowest number entered.

1.1 Use a while-loop to determine the answer.


Do the necessary planning (IPO) and write an algorithm in pseudo code for the following:

1. Display every number even number from 2 to 50 along with its value double and tripled.

1.1 Use a while-loop.


Do the necessary planning (IPO) and write an algorithm in pseudo code for the following:

1 Display every number even number from 2 to 50 along with its value double and tripled.

1.1 Use a for-loop.


1.1 Rewrite the following using the specified looping structure/s:

1.1.1 Use pre-test (for-loop) and a post-test (do-loop until).

num1 = 20

do while x <= -15

display “x = “, x

x = x - 3

loop


1.1.2 Use pre-test (do-while) and a post-test (do-loop until).

for value = 5 to -15 step - 3

display “x = “, x

next value


1.1 In each of the following cases do the following:  Write only the specified structures, do not write the whole algorithm. Make use of the pre-test loop (for-loop and do-while) in pseudocode using the variable names as provided.  The number of times that the loop will execute,  The value of the counter control variable after execution of the loop and e.g. Use a counter variable called count1 that has an initial value of 0 and a final value of 35

(1) a. for count1 = 0 to 5 b. 6 times c. 6 a. count1 = 0 while count1 <=5 b. 6 times c. 6

1.1.1 Use a counter variable called studentCount that has an initial value of 50, a final value of 0, and a decrement of 2.

1.1.2 Use a counter variable called countX that has an initial value of 31, a final value of 15, and an increment of -3.


Algorithm for a program that generates 1000 random numbers between 0 and 100 000. Display the number of odd values generated as well as the smallest and the largest values. Output should be displayed in a windows message box.

 



LATEST TUTORIALS
APPROVED BY CLIENTS