Jump to content

C++ structures

- - - - -

  • Please log in to reply
5 replies to this topic

#1
Junaid92

Junaid92

    Newbie

  • Members
  • Pip
  • 3 posts
Write a program in C++ that takes two inputs in fractions, compute their sum and gives output in fraction. Function should use structures and it should be called from main.^^

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
I assume you are not giving us assignments for us to practise, rather posting an assignment of which was assigned for you to practise.

Have you anything so far for us to look over? Where's your starting code?
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
Junaid92

Junaid92

    Newbie

  • Members
  • Pip
  • 3 posts
please give me the answer. I need it badly...:)

#4
gregwarner

gregwarner

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 853 posts
  • Location:Arkansas
Just for your information, you're not likely to find somebody here to do the work for you or simply provide you with the answer, in case this is a school/work assignment with the intention of you doing it yourself. The members of this forum are much more inclined to help you if you provide the source code you've written thus far and give some description of the specific problem you're having with it.
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.

– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid


#5
fayyazlodhi

fayyazlodhi

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 403 posts

Junaid92 said:

please give me the answer. I need it badly...:)

Please start coding it and let us know where you are stuck. You need it badly because you need to learn programming and doing is the only way. You are not likely to get much further even if you get a solution some how and don't know how to code. Stop begging!

#6
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
I could do it, but I'll warn you: I'd implement a rational class template, and use a few tricks for reducing the rational that you may not be familiar with. It would be painfully obvious to your teacher that you didn't write it.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users