• Home
  • Reviews
  • Articles
  • News
  • Tools
  • GamingHeaven
  • Forums
  • Network
 

Go Back   DriverHeaven.net > Forums > DriverHeaven's Heaven > Off-Topic Forum

Notices

Reply
 
LinkBack Thread Tools
Old Oct 22, 2003, 07:12 PM   #1
Car Audio Guy
 
Join Date: Jul 2003
Location: Atlanta, Ga
Posts: 499
Davidgt is on a distinguished road

Anyone wanna do my homework?

I got homework in ms server 2003 class and andvanced C programming

ms class have to take study notes over 3 chapters sounds easy right? wrong! each chapter in the book is about 105 pages!!! needless to say my fingers hurt from typing in ms word.

in advanced C I have to do a walk trough of this program:

/* Array menu */

#include <stdio.h>
#include <conio.h>
#include <process.h>

/* Global Variable Declarations */
double sub_total = 0;
double final_total = 0;
int index;
int outdex;
int loopcount;

/* Function Definitions */
void menu(void);
char getselect();
int getpounds(char []);
double gettotals(char[], int[]);
void ending(void);


int main()
{

char selection[10];
int pounds[10];

while(1)
{

system("cls");

menu();

for (index = 0; index <= 10; index++)
{

selection[index] = getselect();
pounds[index] = getpounds(selection);
loopcount++;
}

system("cls");

for (outdex = 0; outdex < loopcount -1; outdex++)
{

final_total = gettotals(selection, pounds);

}

ending();
}
return 0;
}

//************************************************** ******************
/* Function Definitions */
void menu(void)
{
printf("\n\nWelcome to Buff's Deli");
printf("\n");
printf("\nA. Ham $1.99lb.");
printf("\nB. Turkey $2.99lb.");
printf("\nC. Roast Beef $3.99lb.");
printf("\nX. Exit");
}

//************************************************** ******************
char getselect()
{

char s;
printf("\nEnter your selection: ");
scanf("%s", &s);

return (s);
}

//************************************************** ******************
int getpounds(char selection[])
{
int p;
if (selection[index] == 'x')
{
p = 0;
index = 11;
}
else
{
printf("Enter the amount of pounds now: ");
scanf("%d", &p);
}
return(p);
}

//************************************************** ******************
double gettotals(char selection[], int pounds[])
{
switch(selection[outdex])

{
case 'a': case 'A':
sub_total = 1.99 * (float) pounds[outdex];
printf("\n\nYour sub total for %d(s) of Ham is: %.2lf", pounds[outdex], sub_total);
break;
case 'b': case 'B':
sub_total = 2.99 * (float) pounds[outdex];
printf("\n\nYour sub total for %d(s) of Turkey is: %.2lf", pounds[outdex], sub_total);
break;
case 'c': case 'C':
sub_total = 3.99 * (float) pounds[outdex];
printf("\n\nYour sub total for %d(s) of Roast Beef is: %.2lf", pounds[outdex], sub_total);
break;
case 'x': case 'X':
sub_total = 0;
outdex = 3;
break;
default:
{
sub_total = 0;
printf("\n\nYour choice of item %c from the menu was invalid.\nYou were not billed for this selection.", selection[outdex]);
break;
}
}

final_total += sub_total;
sub_total = 0;
return (final_total);
}

//************************************************** ******************
void ending(void)
{

printf("\n\n\aYour Final Total is: $%.2lf", final_total);

final_total = 0;
loopcount = 0;

_getch();
system("cls");

}

A walk through is where you write each step that the program does like go through the for loops etc...

any help please?
Davidgt is offline   Reply With Quote
Old Oct 22, 2003, 07:38 PM   #2
tek
F*&k The Police
 
tek's Avatar
 
Join Date: May 2003
Location: Boston, US
Posts: 2,103
tek is on a distinguished road

Thats hott.

tek is offline   Reply With Quote
Old Oct 22, 2003, 09:39 PM   #3
Car Audio Guy
 
Join Date: Jul 2003
Location: Atlanta, Ga
Posts: 499
Davidgt is on a distinguished road

Quote:
Originally posted by tek
Thats hott.

no its cold......... lol
Davidgt is offline   Reply With Quote
Old Oct 22, 2003, 09:45 PM   #4
DriverHeaven Granddaddy
 
Dyre Straits's Avatar
 
Join Date: May 2002
Location: Georgia, USA
Posts: 12,115
Dyre Straits is a name known to allDyre Straits is a name known to allDyre Straits is a name known to allDyre Straits is a name known to allDyre Straits is a name known to allDyre Straits is a name known to all

I read in today's Marietta Daily Journal, that a group of students at an Augusta college were given an assignment: 48 hours to make a 5 minute movie based on a simple one line sentence that was given to them. It had something to do with a lost dime and a vending machine.

From that they had to write a script, shoot the film at various locations, and edit it within 48 hours.

This is also a contest against other students and groups from other areas. The winner gets $10,000.00.
Dyre Straits is online now   Reply With Quote
Old Oct 23, 2003, 12:16 PM   #5
E Pluribus Unum
 
Join Date: May 2002
Posts: 3,203
JavaFox is on a distinguished road

Quote:
Originally posted by Dyre Straits
I read in today's Marietta Daily Journal, that a group of students at an Augusta college were given an assignment: 48 hours to make a 5 minute movie based on a simple one line sentence that was given to them. It had something to do with a lost dime and a vending machine.

From that they had to write a script, shoot the film at various locations, and edit it within 48 hours.

This is also a contest against other students and groups from other areas. The winner gets $10,000.00.
Coolest assignment ever.
JavaFox is offline   Reply With Quote
Old Oct 23, 2003, 12:21 PM   #6
Car Audio Guy
 
Join Date: Jul 2003
Location: Atlanta, Ga
Posts: 499
Davidgt is on a distinguished road

Well I finished my homework I was up to 3am but i got it done since no one would do it for me... ah well prolly better me doing it anyway lol
Davidgt is offline   Reply With Quote
 

 
Powered by: vBulletin
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Artwork by Allan 'Zardon' Campbell, vBulletin implementation by Craig '5320' Humphreys based on original artwork by Ratchet.

All times are GMT -5. The time now is 02:52 AM. Copyright ©2008 HeavenMedia.net