I'll end up google searching shit last minute but I figured since I do that almost every assignment, I should post it up right now. It's not due til next Thursday so I got time to think about it and work it out but I'm just interested to see if anyone here can do this. It is still very simple, it's intro to C++.
4 posters
Do my C++ homework for me >:)
Aid- VIP
- Posts : 2814
Join date : 2011-07-04
Age : 30
Location : Arizona
- Post n°1
Do my C++ homework for me >:)
Aid- VIP
- Posts : 2814
Join date : 2011-07-04
Age : 30
Location : Arizona
- Post n°3
Re: Do my C++ homework for me >:)
PayMistroforDiscreetService.comVaqq wrote:AskMistro.com
I visited but Mistro was not available
Allen's Slave- Member
- Posts : 4445
Join date : 2012-08-09
Age : 30
Location : A$AP
- Post n°4
Re: Do my C++ homework for me >:)
Aid wrote:PayMistroforDiscreetService.comVaqq wrote:AskMistro.com
I visited but Mistro was not available
Lmao just saw this...
Currently obtaining both domain names.
Aid- VIP
- Posts : 2814
Join date : 2011-07-04
Age : 30
Location : Arizona
- Post n°5
Re: Do my C++ homework for me >:)
You'll make millions.. GeniusMistro | Tom wrote:Aid wrote:PayMistroforDiscreetService.comVaqq wrote:AskMistro.com
I visited but Mistro was not available
Lmao just saw this...
Currently obtaining both domain names.
Aid- VIP
- Posts : 2814
Join date : 2011-07-04
Age : 30
Location : Arizona
- Post n°6
Re: Do my C++ homework for me >:)
WHAT THE FUCK AM I DOING WRONGGGGGGGGGGGGGGGG.
Mistro help kthx. As I posted before due tomorrow lolol.
I can't get the data to calculate correctly, it just keeps giving me 0.0 for each of the values when I run it -.- and atm I'm so brain dead I probably missed something.. Other than the values not showing, I have the code working.
Also, my code looks better, the indentation doesn't show proper on here..
=======================================================
#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
using namespace std;
//structure declarations
struct Circle
{
double radius;
double diameter;
double area;
double circumference;
//default constructor here
Circle()
{
radius = 0;
diameter = 0;
area = 0;
circumference = 0;
}
}; //struct Circle
//function prototypes here
Circle getCircleData();
void calculateCircleData(Circle &);
void displayCircleData(Circle);
bool tryAgain();
int main()
{
Circle circle;
int number = 0;
do
{
number++;
cout << "Welcome to our Circle Calculator\n";
cout << "--------------------------------";
cout << endl;
cout << "Circle #" << number << endl;
getCircleData();
calculateCircleData(circle);
displayCircleData(circle);
}while (tryAgain());
}
//function implementation here
Circle getCircleData()
{
Circle circle;
cout << "Enter the radius of the circle (number greater than 0): ";
cin >> circle.radius;
while (circle.radius < 0)
{
cout << "Not a valid input, please enter a valid input (number greater than 0): ";
cin >> circle.radius;
}
return circle;
}
void calculateCircleData(Circle &)
{
Circle circle;
circle.diameter = (circle.radius * 2);
circle.area = (3.1416 * pow(circle.radius, 2));
circle.circumference = (2 * 3.1416 * circle.radius);
}
void displayCircleData(Circle)
{
Circle circle;
cout << fixed << setprecision(2);
cout << endl;
cout << "The circle data is \n";
cout << "Radius: " << setw (6) << circle.radius << endl;
cout << "Diameter: " << setw (6) << circle.diameter << endl;
cout << "Circumference: " << setw (6) << circle.circumference << endl;
cout << "Area: " << setw (6) << circle.area << endl;
}
bool tryAgain()
{
char again;
cout << "Do you want to try again? (Y or N) ";
cin >> again;
if (again == 'Y' || again == 'y')
{
return true;
}
return false;
}
Mistro help kthx. As I posted before due tomorrow lolol.
I can't get the data to calculate correctly, it just keeps giving me 0.0 for each of the values when I run it -.- and atm I'm so brain dead I probably missed something.. Other than the values not showing, I have the code working.
Also, my code looks better, the indentation doesn't show proper on here..
=======================================================
#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
using namespace std;
//structure declarations
struct Circle
{
double radius;
double diameter;
double area;
double circumference;
//default constructor here
Circle()
{
radius = 0;
diameter = 0;
area = 0;
circumference = 0;
}
}; //struct Circle
//function prototypes here
Circle getCircleData();
void calculateCircleData(Circle &);
void displayCircleData(Circle);
bool tryAgain();
int main()
{
Circle circle;
int number = 0;
do
{
number++;
cout << "Welcome to our Circle Calculator\n";
cout << "--------------------------------";
cout << endl;
cout << "Circle #" << number << endl;
getCircleData();
calculateCircleData(circle);
displayCircleData(circle);
}while (tryAgain());
}
//function implementation here
Circle getCircleData()
{
Circle circle;
cout << "Enter the radius of the circle (number greater than 0): ";
cin >> circle.radius;
while (circle.radius < 0)
{
cout << "Not a valid input, please enter a valid input (number greater than 0): ";
cin >> circle.radius;
}
return circle;
}
void calculateCircleData(Circle &)
{
Circle circle;
circle.diameter = (circle.radius * 2);
circle.area = (3.1416 * pow(circle.radius, 2));
circle.circumference = (2 * 3.1416 * circle.radius);
}
void displayCircleData(Circle)
{
Circle circle;
cout << fixed << setprecision(2);
cout << endl;
cout << "The circle data is \n";
cout << "Radius: " << setw (6) << circle.radius << endl;
cout << "Diameter: " << setw (6) << circle.diameter << endl;
cout << "Circumference: " << setw (6) << circle.circumference << endl;
cout << "Area: " << setw (6) << circle.area << endl;
}
bool tryAgain()
{
char again;
cout << "Do you want to try again? (Y or N) ";
cin >> again;
if (again == 'Y' || again == 'y')
{
return true;
}
return false;
}
Allen's Slave- Member
- Posts : 4445
Join date : 2012-08-09
Age : 30
Location : A$AP
- Post n°7
Re: Do my C++ homework for me >:)
Aid wrote:WHAT THE FUCK AM I DOING WRONGGGGGGGGGGGGGGGG.
Mistro help kthx. As I posted before due tomorrow lolol.
I can't get the data to calculate correctly, it just keeps giving me 0.0 for each of the values when I run it -.- and atm I'm so brain dead I probably missed something.. Other than the values not showing, I have the code working.
Also, my code looks better, the indentation doesn't show proper on here..
=======================================================
#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
using namespace std;
//structure declarations
struct Circle
{
double radius;
double diameter;
double area;
double circumference;
//default constructor here
Circle()
{
radius = 0;
diameter = 0;
area = 0;
circumference = 0;
}
}; //struct Circle
//function prototypes here
Circle getCircleData();
void calculateCircleData(Circle &);
void displayCircleData(Circle);
bool tryAgain();
int main()
{
Circle circle;
int number = 0;
do
{
number++;
cout << "Welcome to our Circle Calculator\n";
cout << "--------------------------------";
cout << endl;
cout << "Circle #" << number << endl;
getCircleData();
calculateCircleData(circle);
displayCircleData(circle);
}while (tryAgain());
}
//function implementation here
Circle getCircleData()
{
Circle circle;
cout << "Enter the radius of the circle (number greater than 0): ";
cin >> circle.radius;
while (circle.radius < 0)
{
cout << "Not a valid input, please enter a valid input (number greater than 0): ";
cin >> circle.radius;
}
return circle;
}
void calculateCircleData(Circle &)
{
Circle circle;
circle.diameter = (circle.radius * 2);
circle.area = (3.1416 * pow(circle.radius, 2));
circle.circumference = (2 * 3.1416 * circle.radius);
}
void displayCircleData(Circle)
{
Circle circle;
cout << fixed << setprecision(2);
cout << endl;
cout << "The circle data is \n";
cout << "Radius: " << setw (6) << circle.radius << endl;
cout << "Diameter: " << setw (6) << circle.diameter << endl;
cout << "Circumference: " << setw (6) << circle.circumference << endl;
cout << "Area: " << setw (6) << circle.area << endl;
}
bool tryAgain()
{
char again;
cout << "Do you want to try again? (Y or N) ";
cin >> again;
if (again == 'Y' || again == 'y')
{
return true;
}
return false;
}
Let me see what I can find.
k099str- Recruit
- Posts : 1180
Join date : 2013-03-20
Age : 30
Location : Wisconsin
- Post n°8
Re: Do my C++ homework for me >:)
coding looks really intimidating.
Aid- VIP
- Posts : 2814
Join date : 2011-07-04
Age : 30
Location : Arizona
- Post n°9
Re: Do my C++ homework for me >:)
Mistro here:
http://cplusplus.com/forum/general/97843/
Easier to read code, plus some guy is trying to help me. Still I don't have it but that's my latest code in easier to read formatting
Edit: I figured it out Even though that guy helped me a lot, it seems a lot of the 'smart c++ people' are really douchey towards beginners. Like they expect we should know everything that we make mistakes on lol.
http://cplusplus.com/forum/general/97843/
Easier to read code, plus some guy is trying to help me. Still I don't have it but that's my latest code in easier to read formatting
Edit: I figured it out Even though that guy helped me a lot, it seems a lot of the 'smart c++ people' are really douchey towards beginners. Like they expect we should know everything that we make mistakes on lol.
Allen's Slave- Member
- Posts : 4445
Join date : 2012-08-09
Age : 30
Location : A$AP
- Post n°10
Re: Do my C++ homework for me >:)
Aid wrote:Mistro here:
http://cplusplus.com/forum/general/97843/
Easier to read code, plus some guy is trying to help me. Still I don't have it but that's my latest code in easier to read formatting
Edit: I figured it out Even though that guy helped me a lot, it seems a lot of the 'smart c++ people' are really douchey towards beginners. Like they expect we should know everything that we make mistakes on lol.
Sorry bud, had training all night! Glad you got it though!
And yeah.. Please don't pay attention to them, everyone starts at the same exact spot, everyone has gone through coding problems. Good for you for fixing it though man! Looking sexy! ;D
|
|