d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > Homework Help > Need Help On C++
Add Reply New Topic New Poll
Member
Posts: 11,027
Joined: Oct 16 2013
Gold: Locked
Trader: Scammer
Oct 3 2017 11:06am


I am very new to this and do not know what I'm doing, any help would be appreciated
Member
Posts: 17,255
Joined: Mar 13 2009
Gold: 0.00
Oct 4 2017 02:37am
To help you think about how to program, the key concept is to think 'logically'. It is a step by step process. Once you have mastered this concept then you will be a great programmer.

So you have to create a program that: 1) Displays Accepts user inputs, 2) calculates the area of a shape and 3) Displays the results.

So first thing you would do is:

Write the code that asks for user input and -
Write the code that prints the text to the screen asking for user input.

You are also told to define constant PI and make PI = 3.14159;

So now you have a baseline, the code at this point prompts for user input and displays the text on the screen.

You are now told to have if/else statements based on the 4 different options.

so if user presses 1 then the code will print 'Area of the square: ' then prompt for user input.
Then to find area of the square you would go var = var * var and print 'Area = ' + var.

Once you have this completed for the first option then the rest of the options should be easy enough.

Now I personally haven't done C++, I instead did OOP but the concept of programming is the same nonetheless.
Just learn to think logically and step by step. If you can explain in plain English what you want the code to do then you can create a program that will do that exact thing.

Hope this helps.
Member
Posts: 22,268
Joined: May 26 2007
Gold: 100.24
Oct 4 2017 03:34am
Ummm... Not sure if troll or not. The instructions are there and they even slice the problem into very easily understandable chunks of code. I haven't done real coding in years and this wouldn't take many minutes to finish.

So. What's the problem more specifically? Look at those lines in the code frame provided in the assignment. It tells you quite thoroughly what to do. You're almost done when you implement those.

This post was edited by BABYMETAL on Oct 4 2017 03:35am
Member
Posts: 20,223
Joined: Apr 30 2008
Gold: 5,169.82
Oct 4 2017 10:29am
What problems are you facing?
Member
Posts: 5,348
Joined: Sep 15 2017
Gold: Locked
Oct 22 2017 05:07am
Step4: print a copy of the source c... wait WHAT ?
Doesn't your teacher at least compile your program with debugging tools like gdb/valgrind ? Lol I bet you have paper coding assignment :rofl:

I'd write the code for fg tho
Member
Posts: 5,935
Joined: May 3 2010
Gold: 93.00
Oct 22 2017 01:24pm
Quote (CPK001 @ Oct 4 2017 04:37am)
To help you think about how to program, the key concept is to think 'logically'. It is a step by step process. Once you have mastered this concept then you will be a great programmer.

So you have to create a program that: 1) Displays Accepts user inputs, 2) calculates the area of a shape and 3) Displays the results.

So first thing you would do is:

Write the code that asks for user input and -
Write the code that prints the text to the screen asking for user input.

You are also told to define constant PI and make PI = 3.14159;

So now you have a baseline, the code at this point prompts for user input and displays the text on the screen.

You are now told to have if/else statements based on the 4 different options.

so if user presses 1 then the code will print 'Area of the square: ' then prompt for user input.
Then to find area of the square you would go var = var * var and print 'Area = ' + var.

Once you have this completed for the first option then the rest of the options should be easy enough.

Now I personally haven't done C++, I instead did OOP but the concept of programming is the same nonetheless.
Just learn to think logically and step by step. If you can explain in plain English what you want the code to do then you can create a program that will do that exact thing.

Hope this helps.


I've only ever taken 1 class on some very basic program, I think mit app inventor, and the way you just laid that out finally made that class click for me. Good post imo :thumbsup:
It now seems like if you were teaching a child something new.. you have to literally approach it as a blank slate and instruct them to do all the menial common sense stuff.
Member
Posts: 16,794
Joined: Oct 15 2008
Gold: 19,640.61
Oct 22 2017 06:51pm

#define PI 3.14159
Go Back To Homework Help Topic List
Add Reply New Topic New Poll