• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

C++ homewrok

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,I have three homework questions.i already finished two of them but couldn't solve this one.Can you guys help me to solve this.Thank u.Also,i am a beginner,so It would be really helpful if you guys write it in details.


Write a program which manipulates fractions.

It should get two fractions from the user by inputing two numerators and two denumerators (integers) from 0 to 999 and then have the user select an operation from addition, subtraction, multiplication, and division, check for input errors (<0 or >999) and for division by 0 and gives appropriate error messages, terminating in case of error.
It then displays the two fractions in fraction form, the operation between them and the result of the operation in fraction form and the result of the division.

Take care of the fraction line!

Example:



The program should then give the option to the user to repeat the process and enter a new pair of fractions or terminate the program.


 
Sheriff
Posts: 4904
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Pauline, and welcome to the Ranch!

Fortunately, for your learning process, nobody here is going to do your homework for you. (See why --> DoYourOwnHomework). However, we will gladly help you with any specific problems you are having while working on it yourself. The best way to get help is to show us what you have done so far and explain nice and clearly what the particular problem is you are having with it.
 
pauline gomes
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey,thank you,i didn't know that,so here is what i did so far.
 
Tim Cooke
Sheriff
Posts: 4904
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, and what's the problem?

(p.s. It's best to UseCodeTags (<-- click) when posting code in the forum. I've added them for you this time, see how much better it looks!)
 
pauline gomes
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it the right way to do it?
 
Tim Cooke
Sheriff
Posts: 4904
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it satisfy all of the requirements?
 
Tim Cooke
Sheriff
Posts: 4904
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might think I'm being difficult or awkward, but I'm encouraging you to be analytical of your own program, to be methodical in your testing process, to be clear of the requirements and verify that what you've done satisfies them, completely.
 
Ranch Hand
Posts: 411
5
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using C I/O in a C++ program?
 
reply
    Bookmark Topic Watch Topic
  • New Topic