You are on page 1of 3

Act2a.

CS
Create a complete C# program that will compute for the minimum number of moves based on
the inputted number of disks. Provide its equivalent flowchart and pseudocode.

Start
Enter Number of disks
Compute using exponent power
Print inputted number
Print Result
Stop

This study source was downloaded by 100000853843080 from CourseHero.com on 10-02-2022 05:36:09 GMT -05:00

https://www.coursehero.com/file/80352614/Act2adocx/
Act2b.CS
Create a complete C# program that will find the nth Fibonacci number. Use the formulas in
finding the odd and even fibonacci number. Provide its equivalent flowchart and pseudocode.

Start
Enter Number
IF num1 % 2==0
Compute to (Math.Pow(1.618, num1)) + (Math.Pow(1.618, -num1))) / Math.Sqrt(5)
Output “Ans: ” + Math Round(fib)
ELSE
Compute to (Math.Pow(1.618, num1)) - (Math.Pow(1.618, -num1))) / Math.Sqrt(5)
Output “Ans: ” + Math Round(fib)
Stop IF
IF fib % 2 == 0
OUTPUT “The number :” + Math.Round(fib)+ "is even."
ELSE
OUTPUT“The number :” + Math.Round(fib)+ "is odd."
STOP

This study source was downloaded by 100000853843080 from CourseHero.com on 10-02-2022 05:36:09 GMT -05:00

https://www.coursehero.com/file/80352614/Act2adocx/
Act2c.CS
Create a complete C# program that will determine the Greatest Common Divisor (GCD) or two
inputted integers. Provide its equivalent flowchart and pseudocode.

START
Get First and Second Number
Compute through GCD int a, int b
GCD Start while loop
Where a % b
User a to be b
And user b to be remainder
Stop While loop and return to a
Write First number and Second number
Compute first and second number using GCD
OUTPUT First number and second number and the Result from GDC
STOP

This study source was downloaded by 100000853843080 from CourseHero.com on 10-02-2022 05:36:09 GMT -05:00

https://www.coursehero.com/file/80352614/Act2adocx/
Powered by TCPDF (www.tcpdf.org)

You might also like