Someone please help. I need help converting the following 2 algorithms into C.
Dollar_Manipulator
Set cash(index) to 10*
Set num to 2
Repeat
Add 1.5 to cash(num)
Add 2 to num
Until(num == 10)
Set num to 1
Repeat
If (num%3 == 0) Then
Subtract 3.3 from cash(num)
EndIf
If (num%4 == 0) Then
Multiply cash(num) by 2
EndIf
Until (num == 10)
Prompt for num
Get num
Set lucky_num to (num%10)
Set num to 1
Repeat
If (num == lucky_num) Then
Do Nothing
Else
Add cash(num) to cash(lucky_num)
EndIf
Until (num == 10)
Display cash(index)*
End
*Note that index = 10. You are declaring, initializing, and displaying the array of 10 locations numbered 1 to 10. Make necessary changes in C to reflect this.
Misc_Program
Set MAX to 10
Set MID to 5
Set MIN to 1
Do index = MIN to MAX
Set array(index) to 0
Display array(index)
If (array(index) == 2 Or 4 Or 6 Or 8) Then
Add index— to array(index)
Else
Add index to array(index)
EndIf
EndDo
Display modified array message
Do index = MIN to MAX
Display array(index)
EndDo
End