As you'll notice this is an assignment from my computer science class, and if you look closely you'll also notice that this was due on march 3, so im not trying to get help for it. All this is for is to create some friendly competition and maybe keep the wheels turning smoothly for some of you who may be a bit rusty.

The only requirements i ask you to follow for this are:
 read the entire thing and make sure you fully comprehend it, i think i may grade it or something when you post the code.
 and follow all the requirements it states, Except the ipo and flowchart stuff, i just want you to post your code.

Enjoy!
[IMG]http://i720.photobucket.com/albums/ww207/camdaddy_2008/page1.jpg[/IMG]
[IMG]http://i720.photobucket.com/albums/ww207/camdaddy_2008/page2.jpg[/IMG]

Recommended Answers

All 6 Replies

This is incredibly insulting. Do you honestly think we are this stupid? Please, do yourself a favor and don't post here again.

Also, regardless of my level of rust, I'm sure I could handle this joke of a program. You seriously can't do it yourself?

commented: rude +0
commented: Rude? Nah.True? Yup. +12

I didn't post this for experienced programmers, I understand it's simple, that's the idea. It's for beginners on the forum, so really it's kind like a tutorial. So you can stop blasting insults at me, and yes I know how to do this, if you will notice the due date on the image said march 3 and since apparently your so intelligent I shouldn't have to tell you that it's may 13th, longafter the due date.

I didn't post this for experienced programmers, I understand it's simple, that's the idea. It's for beginners on the forum, so really it's kind like a tutorial. So you can stop blasting insults at me, and yes I know how to do this, if you will notice the due date on the image said march 3 and since apparently your so intelligent I shouldn't have to tell you that it's may 13th, longafter the due date.

Honestly, you don't know what students would invent to avoid doing their own assignments, I'm long enough on this forum to make that observation. Can you even believe that there are in fact students who spend more time by avoiding work, than by just doing it on their own?
If you really want us to believe you, then you could just post your attempt, even if you've lost it, then you can simply reprogram it quickly. As you said yourself: it's simple. Or are you maybe suggesting the idea that you're superior and that your code is 100% perfect, like many people think? There's a difference between a solution and a good solution, and I'm sure that many folks here are willing to review your attempt, and making suggestions, to make your work even a better solution.

commented: not an asshole +0

I wasnt suggesting that im superior. I honestly didnt realize that this would blow up in my face, all i was trying to do was to give a little assignment for beginners.

#include <stdio.h>
#include<stdlib.h>

#define Pi 3.14159
void ColorOfPaintFunc(void);

int main ( void ) {
	
    double Radius, 
	NumberOfGallons,
	height,
	diameter,
	TotSqFt,
	heightFeet,
	diameterFeet,
	remainder;
float CostOfPaint,
	CostPerGallon,
	SalesTax,
	TotalCost;
int PaintSqFt,
	IntNumOfGallons;
	char ColorType;
	printf("Please follow the onscreen instructions and when you are done answering a question press enter.\n");
	printf("Please type the height in meters :\n\n");
	scanf("%lf", &height);
	
	printf("Now, please enter the diameter in meters :\n\n");
	scanf("%lf",&diameter);
	
	printf("Please select the color of paint by either typing a lowercase w for white or a lowercase b for black :\n\n");
	scanf("%s",&ColorType);

	
	system ("cls");
	
	// Decision to determine the color of paint
	
	if ( ColorType == 'w')
	{
		PaintSqFt = 250;
		CostPerGallon = 29.75; 
	}
	else {
		PaintSqFt = 275;
		CostPerGallon = 32.05;
	}
	
	
	heightFeet= height *3.281;
	diameterFeet= diameter * 3.281;
	Radius = diameterFeet / 2;
	TotSqFt = (2*(2*Pi*Radius*heightFeet)+(2*(Pi*(Radius*Radius))));
	NumberOfGallons = TotSqFt / PaintSqFt;
	remainder = NumberOfGallons-(int)NumberOfGallons;
	
	// Decision to determine whether to round up or not
	if ( remainder > 0)
		IntNumOfGallons = NumberOfGallons+1;
	else
		IntNumOfGallons = (int)NumberOfGallons;
	
	CostOfPaint = IntNumOfGallons * CostPerGallon;
	SalesTax = CostOfPaint * .0825;
	TotalCost = CostOfPaint + SalesTax;
	
	printf("\n%54s\n","Bid for cylindrical structure");
	printf("%52s\n","From Camdaddy Contractors");
	printf("%54s\n\n\n","by Cameron Belt, Salesperson");
	printf("%27s%1.0lf%36s%2d\n\n", "Height of structure :", height,
		   "Gallons of paint needed : ", IntNumOfGallons);
	printf("%27s%1.0lf%36s%4.2lf\n\n","Diameter of structure :", diameter,
		   "Total surface area in feet : ", TotSqFt);
	printf("%27s","Color preference :");
	
	// Decision to print "White" or "Black" on the screen
	ColorOfPaintFunc();
	
	printf("%33s%3.2f\n", "Total cost of paint : $ ", CostOfPaint);
	printf("%66s%4.2f\n","Sales tax : $ ", SalesTax);
	printf("%30s%4.2f%37s\n","Cost per gallon : $ ", CostPerGallon,"+______");
	printf("%66s%4.2f\n\n\n\n\n\n","Total Cost : $ ", TotalCost);
	printf("%62s","Thanks for choosing Camdaddy Contractors!!\n\n");
	
	
system("pause");
    return 0;
}
void	ColorOfPaintFunc(void)
{ double PaintSqFt;
	if (PaintSqFt > 250)
		printf(" %2s", "Black");
	
	else
		printf(" %2s", "White");
	
}

Honestly, you don't know what students would invent to avoid doing their own assignments, I'm long enough on this forum to make that observation. Can you even believe that there are in fact students who spend more time by avoiding work, than by just doing it on their own?
If you really want us to believe you, then you could just post your attempt, even if you've lost it, then you can simply reprogram it quickly. As you said yourself: it's simple. Or are you maybe suggesting the idea that you're superior and that your code is 100% perfect, like many people think? There's a difference between a solution and a good solution, and I'm sure that many folks here are willing to review your attempt, and making suggestions, to make your work even a better solution.

thank you for not being a butthole about it.

if you will notice the due date on the image said march 3 and since apparently your so intelligent I shouldn't have to tell you that it's may 13th, longafter the due date.

So what? I've had professors decide to extend my projects plenty of times. I apologize for the short fuse, but be sure to read the rules in the future, since what you posted would be considered homework. I shouldn't have to tell you how many times we've heard the same sorts of things... there is no way to distinguish your motive, so we have one steadfast rule that help and examples will be given but exact code will not. Pretty self-explanatory.

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.