
-----------------------------------
nigana
Tue May 12, 2009 9:55 am

Need Help Right Away!
-----------------------------------
var num1,dem1,num2,dem2:int
loop
put "please enter the number of the first fraction:  "..
get num1
put "please enter the denominator of the first fraction:  "..
get dem1
put "please enter the number of the second fraction:  "..
get num2
put "please enter the number of the second fraction:  "..
get dem2

if dem1 not=dem2 then
var dem:int:=dem1*dem2
var num3:int:=dem2*num1
var num4:int:=num2*dem1
put num3+num4,"/",dem
elsif dem1=dem2 then
var num5:int:=num1+num2
put num5,"/",dem1
end if 
end loop

how do we simply the answer can you give us the code plz!!

Mod Edit: Remember to use syntax tags! Thanks :) Code Here

-----------------------------------
nigana
Tue May 12, 2009 10:05 am

Re: Need Help Right Away!
-----------------------------------
can someone help me with this questions, i am really confused.



5.Write a program that inputs two fractions in the form a/b and c/d, and outputs their sum in the form p / q cancelled down to its simplest form. This should continue until the user types in an exit command of your choice.

Sample run:	Input: 5/6 1/10 
Output: 14/15

var num1,dem1,num2,dem2:int
loop
put "please enter the number of the first fraction:  "..
get num1
put "please enter the denominator of the first fraction:  "..
get dem1
put "please enter the number of the second fraction:  "..
get num2
put "please enter the number of the second fraction:  "..
get dem2

if dem1 not=dem2 then
var dem:int:=dem1*dem2
var num3:int:=dem2*num1
var num4:int:=num2*dem1
put num3+num4,"/",dem
elsif dem1=dem2 then
var num5:int:=num1+num2
put num5,"/",dem1
end if 
end loop


how do you simply the fraction plz give the code to us !

-----------------------------------
DifinityRJ
Tue May 12, 2009 11:14 am

Re: Need Help Right Away!
-----------------------------------
Please take the the time to post a well structured post, and refrain from double posting.  Also try reading the guides on posting succesful help posts.

Once you've read all the guidelines, we will take the time to help you.

Thanks.

-----------------------------------
CentiZen
Tue May 12, 2009 11:18 am

RE:Need Help Right Away!
-----------------------------------
Yeah, I found this post a little hard to understand. Rephrase it and then I will try to help.
