[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
C++
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /adv/ - Advice

Thread replies: 10
Thread images: 3
File: 1.png (18 KB, 1055x374) Image search: [Google]
1.png
18 KB, 1055x374
Hey guys sorry to bother but I'm stuck with a part in my programming homework .I'm supposed to write a math tutor program for young students to practice multiplication, subtraction, addition and division. I'm stuck with the division part because the professor wants it in a very specific way
>Division Problems
>- Display these problems horizontally as: >Operand1 / Operand2 = , a.k.a, Dividend / Divisor =
> - The range for the divisor (operand 2) must be from 1 to 9, inclusive
> - The dividend (operand 1) must have a value such that the resulting quotient is always in the range of 1 to 50, inclusive
And also it should give no division that results in decimals
>>
File: 2.png (18 KB, 851x458) Image search: [Google]
2.png
18 KB, 851x458
pic related is what I got so far
Thank you for your help
>>
>>17280015
Randomly generate the quotient, multiply it by the randomly generated divisor, and that's your dividend.
Easy peasy buddy.
>>
I almost forgot
>In this assignment you will write and submit two different C++ programs. Make sure you name each one as indicated in the requirements below and submit each one individually via Canvas. When writing these programs, only use sequence, selection, and repetition. Do not include any features not yet covered in the course. Also remember to use standard C++, do NOT use statements that are not allowed in this course, follow all applicable coding conventions, and write a meaningful prolog at the beginning of your source code file. Your submitted C++ code MUST compile in order to earn more than 10% of the points for the assignment in question. Finally, the statements in this paragraph apply to ALL submitted assignments for this course.
>>
File: 0w0.jpg (168 KB, 1024x1024) Image search: [Google]
0w0.jpg
168 KB, 1024x1024
>>17280031
Thank you very much
>>
>>17280032
>When writing these programs, only use sequence, selection, and repetition. Do not include any features not yet covered in the course.
>Also remember to use standard C++, do NOT use statements that are not allowed in this course
Fucking what. I don't even know what this "sequence, selection, and repetition" bullshit is.
Intentionally limiting students to only basic shit that's been covered in the course is silly, although I guess it may make things easier on the graders.

Now, unless any of that garbage applies to what I posted above, I'm pretty sure you've got a viable solution.
>>
>>17280049
No worries, friend. Happy coding.
>>
>>17280056
I know but I guess he also does it because it's kind of easy to cheat if you have a friend who has taken the course
>>
>>17280016
i don't think the code from line 29 should be there.
use either endl or \n, but 30 and 31 are just inconsistant
why is leftover a double ? % returns an integer
and you never validate if the user actually entered a integer at line 32.
>>
>>17280122
just dumb mistakes and this was a separate part of the main code just to mess around and see what worked
Thread replies: 10
Thread images: 3

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.