Hello ...I am a student in the second year engineering,,, I find it difficult to solve some questions in C + + anyone knows solve these questions, please help me, and I would be very happy

These questions:
Q1- Write a c++ program containing a loop to print all the integers from 200 to 300 that have a remainder of four (4) when divided by eight (8).

Q2-
Write a function volume ( ) which returns the volume of a cylinder.
V=πr2h

Q3-
Write a program to convert given amount in US$ to Omani Riyals by reading the amount in US$ from a file and write the equivalent amout in Omani Riyal to another file.
1 OMR= 2.597 US$.

Thank you

Recommended Answers

All 2 Replies

First off, we don't do other people's homework for them. Second, we don't do other people's homework for them. And third, we don't do other people's homework for them. Sensing a pattern here yet?

No one here will simply hand you a solution on a silver platter. If you show us what you've done, what you've tried to do, and what problems you've had with it, then we'll be happy to help. If you have specific questions, we can answer them, or at least point you in the right direction. If you have a program with a bug you can't swat on your own, we'll be glad to assist, so long as you pay attention to the forum rules and post sensible questions in an intelligent manner that we have some reasonable hope of answering.

But just cutting and pasting an assignment into a message, without even prefacing it with something like, "I have this homework problem that I can't solve...", is likely to get you booted from the message boards here and elsewhere - if you're lucky. What happens to you if you are unlucky is... well... let's just say that this guy probably won't be trying that again, on that forum or this one.

We take this issue seriously here. Very seriously. Asking us to do homework for you is a grave breach of academic ethics on your part, and actually doing so would be an even bigger breach on ours (not that this stops the many fine mercenaries at Freelancer.com, but still). Simply posting this here, in this way, could get you expelled from your school, if someone happens to notice it and blow the whistle on you. Furthermore, it does neither you nor us any good to help you cheat - especially since there's a good chance some day one of us will have to work with you, manage you, or, Eris forefend, fix code you've written. We have an obligation to our profession and our own future sanity to help you become a good programmer, and doing your coursework for you isn't going to do that.

And please don't insult our intelligence by claiming that it isn't a class assignment. It's very easy to spot one, and we have a lot of practice at it. Trust me on this.

Now, if you actually don't know how to create a program that fits the requirements... hmmmn. Reading the book is definitely called for. As is speaking to the professor; while some can be a-holes about office hours, most are more than willing to give extra help, if only to keep their class grades from slipping to the point where they get re-assigned to teach remedial basketweaving.

I don't want to tell you exactly how to do the problems, because that wouldn't be of any good to either of us, so I'll just give you some hints.

Q1: Use the % operator to check the remainder of any number divided by another. The remainder has to be 4, and you're dividing by 8. So all you really have to do is plug in the numbers from 200 to 300 right? You should be able to figure out how to do that part.

Q2: Just use multiplication. The function should probably take r and h as parameters.

Q3: This is just multiplication. You don't even have to solve for OMR because you know what it is. If you're having a problem with this, it's probably not C++ that's troubling you, but programming/mathematics in general. Give it a try, it's really not as hard as you probably think it is.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.