Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming

Reply
 
LinkBack Thread Tools
Old 04-10-08   #21 (permalink)
i click home too much
 
G|F.E.A.D|Killa's Avatar
 
intel nvidia

Join Date: Jul 2007
Location: arizona
Posts: 6,362
Blog Entries: 3

Rep: 400 G|F.E.A.D|Killa is a proven memberG|F.E.A.D|Killa is a proven memberG|F.E.A.D|Killa is a proven memberG|F.E.A.D|Killa is a proven memberG|F.E.A.D|Killa is a proven member
Unique Rep: 276
Hardware Reviews: 9
Trader Rating: 5
Default

ahhh reminds me of my old program i made along time ago. it calculated how may times a ball will bounce and the feet between each bounce with givin variables. nice job man.
__________________
Quote:
if you can watch it and you can hear it, you can copy it
4.5GHz E8400
19849dmark06 Vista 20038 3dmark06 XP
Quote:
Originally Posted by Pawn-Shop View Post
lol @ this ad
Intel: 2 > 3
Consumer: does this mean 3 > 4?
Consumer #2: WAIT! If 2 > 3, and 3 > 4, then 2 > 4. E8500 > QX9770!!!

System: Lurking Ninja (under construction)
CPU
Intel Core 2 Duo E8400 3.6/1.216 Q746A366 *lapped*
Motherboard
EVGA 132-CK-NF78-A1 LGA 775 NVIDIA nForce 780i SLI
Memory
OCZ Platinum 6GB PC2 8500 @ 800mhz 4-4-4-8 1T
Graphics Card
-
Hard Drive
2X WD 250GB AAKS in RAID 0 WD 400GB slave.
Sound Card
X-fi XtremeGamer Fatality Pro. *Modded blue LED*
Power Supply
PC Power Cooling 750 Quad black
Case
modded rocketfish
CPU cooling
Zerotherm Nirvana NV120 *lapped*
GPU cooling
-
OS
Windows Vista Premium X86/Vista Ultimate X64
Monitor
LG 19" widescreen 2000:1 contrast ratio
G|F.E.A.D|Killa is offline Overclocked Account   Reply With Quote
Old 04-10-08   #22 (permalink)
New to Overclock.net
 
DeRock131's Avatar
 
intel nvidia

Join Date: Mar 2008
Location: Chicago, IL
Posts: 625

Rep: 53 DeRock131 is acknowledged by some
Unique Rep: 51
Trader Rating: 0
Default

I think case 7 can be shortened.

I dont remember exactly anymore because its been 2-3 years, but i think there is a function that compresses those.
__________________
System: Baby Gamer
CPU
E6850
Motherboard
GA-P35-DS3L
Memory
G.SKILL 2GB DDR2 1066
Graphics Card
EVGA 8800GS 384MB
Hard Drive
Seagate 250gb SATA
Sound Card
Onboard
Power Supply
CM ProPower 550w
Case
CM690
CPU cooling
Freezer 7 Pro
GPU cooling
Zalman
OS
Vista x86/ Ubuntu 8.04 x64
Monitor
42" LG LCD TV
DeRock131 is offline   Reply With Quote
Old 04-10-08   #23 (permalink)
New to Overclock.net
 
Join Date: Apr 2008
Posts: 6

Rep: 0 rubendodge Unknown
Unique Rep: 0
Trader Rating: 0
Default

I updated it will be coding in it for alittle while longer (hour or 2) then I will be done for the night but in the mean time check and see if I add anythign new or change anythign on my first post.
rubendodge is offline   Reply With Quote
Old 04-10-08   #24 (permalink)
Chiefly Ignorant
 
Scriptorum's Avatar
 
intel nvidia

Join Date: Jan 2008
Location: Atlanta, GA
Posts: 54
Blog Entries: 12

Rep: 13 Scriptorum Unknown
Unique Rep: 10
Trader Rating: 0
Default

Quote:
Originally Posted by rubendodge View Post
Ok I will work on adding some of these ideas. The only real problem is the whole thing about making it be able to restart the app after a operation. I've never done it before so I'm still newbie lol.
To make an app "restart," use a loop. One example:

Code:
int menuchoice = -1;
while(menuchoice != 14)
{
  cin >> menuchoice;
  performOperation(menuchoice);
}
__________________
Quote:
Originally Posted by The Bartender Paradox View Post
crazy?...nah. when you cool with a fire extinguisher then your crazy.

System: Flaming Moe's MacBook Pro
CPU
Core 2 Duo
Motherboard
MacBook Pro
Memory
4GB DDR2-667
Graphics Card
512Mb NVIDIA GeForce 8600M GT
Hard Drive
200Gb 7200RPM
OS
OSX 10.5.2 / XP Pro / Boot Camp + Parallels
Monitor
17" Matte 1920x1200
Scriptorum is offline Overclocked Account   Reply With Quote
Old 04-10-08   #25 (permalink)
Overclocker
 
dankoni's Avatar
 
intel nvidia

Join Date: Nov 2007
Location: West Chester, PA
Posts: 1,292

Rep: 63 dankoni is acknowledged by some
Unique Rep: 57
Folding Team Rank: 129
Trader Rating: 0
Default

I didn't have time at work to look through the whole thing, but I can make a couple quick suggestions for the calculator.

1. For subtraction, why are you making the user enter the larger number first? Can you not figure out a way to handle negative numbers?

2. For division, you should have a guard against dividing by 0, otherwise it will crash the program.

And like I saw someone else say, you should also check to make sure the input is actually a number.

You say you are in your first month of programming? Looking good
__________________
Manufacturing Consent is the Name of the Game
---------------------------------------------------------------
---------------------------------------------------------------

System: DankoniQuad
CPU
Q6600 G0 @ 3.4GHz (425x8)
Motherboard
DFI Blood Iron P35-T2RL
Memory
Ballistix DDR2-800 4x1GB @850MHz
Graphics Card
Galaxy 8800GT 512 @ 700/1750/2000
Hard Drive
2xWD6400AAKS RAID0 + 2x74GB 7200.7 RAID0 + 500GB
Sound Card
HT Omega Claro Plus+
Power Supply
Corsair TX750W
Case
Antec Nine Hundred
CPU cooling
Tuniq Tower 120
GPU cooling
Stock
OS
Vista Ultimate 64-bit
Monitor
Acer AL2216Wbd 22" LCD
dankoni is offline I fold for Overclock.net   Reply With Quote
Old 04-10-08   #26 (permalink)
Overclocker in Training
 
.dp-BarackObama's Avatar
 
intel nvidia

Join Date: Feb 2008
Location: Indiana
Posts: 157

Rep: 5 .dp-BarackObama Unknown
Unique Rep: 5
Hardware Reviews: 2
Trader Rating: 0
Default

looks pretty exciting.
__________________
ß₤ứə Çřёώ
[b]3DMARK06: 9623/B]
XBOX360 GAMERTAG: Spankey4861

System: HELENKELLER
CPU
Q6600 @ 2.4
Motherboard
eVGA 780I
Memory
4 GB OCZ SLI RDY
Graphics Card
EVGA 8800GTS
Hard Drive
400GB WD/Seagate Internal / 500 WD External
Sound Card
SB X-Fi Audio [AC00]
Power Supply
Ultra X2 750watt
Case
Ultra Aluminus Mid-Tower
CPU cooling
AC Freezer 7
GPU cooling
80mm
OS
Vista X86
.dp-BarackObama is offline   Reply With Quote
Old 04-10-08   #27 (permalink)
Audiophile
 
redsunx's Avatar
 
intel nvidia

Join Date: Apr 2007
Location: ☞ Right here ☜
Posts: 2,081

Rep: 135 redsunx is acknowledged by manyredsunx is acknowledged by many
Unique Rep: 97
Trader Rating: 4
Default

I hate programming.
__________________
Bent LGA pins?! Never fear the solution is here!
╩╪Unofficial Lego Lovers Club╩╪

For sale: Pentium 4 2.8 GHz Northwood & 478 Biostar P4M900-M4 Motherboard
Quote:
Originally Posted by MasterShake in chat
oem's are the biggest scam since toast

System:  
CPU
e2180 3Ghz(1.325v)
Motherboard
DFI Blood Iron T2RL
Memory
4x1GB of G.Skill 752Mhz 1.9v
Graphics Card
EVGA 8800GT (eh, I'll push it sometime in life)
Hard Drive
320GB Seagate >9000 200GB Seagate (External)
Sound Card
Some onboard ass
Power Supply
OCZ 600w StealthXStream
Case
lolcase
CPU cooling
ARCTIC COOLING Freezer 7 Pro
GPU cooling
Stock (PCI Cooler)
OS
Ultimate x64
Monitor
17inch HP 1280x1024
redsunx is online now   Reply With Quote
Old 04-10-08   #28 (permalink)
Overclocker in Training
 
.dp-BarackObama's Avatar
 
intel nvidia

Join Date: Feb 2008
Location: Indiana
Posts: 157

Rep: 5 .dp-BarackObama Unknown
Unique Rep: 5
Hardware Reviews: 2
Trader Rating: 0
Default

haha booo!
__________________
ß₤ứə Çřёώ
[b]3DMARK06: 9623/B]
XBOX360 GAMERTAG: Spankey4861

System: HELENKELLER
CPU
Q6600 @ 2.4
Motherboard
eVGA 780I
Memory
4 GB OCZ SLI RDY
Graphics Card
EVGA 8800GTS
Hard Drive
400GB WD/Seagate Internal / 500 WD External
Sound Card
SB X-Fi Audio [AC00]
Power Supply
Ultra X2 750watt
Case
Ultra Aluminus Mid-Tower
CPU cooling
AC Freezer 7
GPU cooling
80mm
OS
Vista X86
.dp-BarackObama is offline   Reply With Quote
Old 05-27-08   #29 (permalink)
New to Overclock.net
 
Join Date: Apr 2008
Posts: 6

Rep: 0 rubendodge Unknown
Unique Rep: 0
Trader Rating: 0
Default

Ok I added some suggestions you guys stated I am still having errors and problems with getting the "loop" idea to work right lol.

I added like 5-6 new options and made the program ALOT more organised enjoy guys .

Last edited by rubendodge : 05-27-08 at 03:09 PM.
rubendodge is offline   Reply With Quote
Old 05-28-08   #30 (permalink)
New to Overclock.net
 
Join Date: May 2008
Location: Nottingham, UK
Posts: 24

Rep: 7 Stormwolf Unknown
Unique Rep: 5
Trader Rating: 0
Default

You don't have to 'restart' the program - you need to wrap the innards of the program in a loop. C++ has 3 loop structures - for this style you would probably want to use a do..while loop because you want to present options and get input at least once then test the loop condition at the 'end': i.e.

Code:
{
 //snippet
  const int ExitCode = -1;
  const int NumMainMenuOpts = 6;

  do
  {
     display_base_menu_opts();
     // limit possible input values from 1..6
     menuchoice = read_valid_key_input(NumMainMenuOpts); 

     switch(menuchoice)
     {
      case 1: do_stuff();
                 break;

     case 2: do_more_stuff();
                break;  

     case 3..5: // etc.
     case 6: menuchoice = ExitCode; // assign 'impossible to reach' value
                 break;

      default: cout << "unhandled menu option error" << endl;
                  break;

     };

  }while (menuchoice != ExitCode);

  //clean up and exit
}
You can then structure your submenus within your worker functions similarly. Each task should be contained within the scope of its own function... they do teach you functions in your programming class right? 'do_stuff()' and 'do_more_stuff()' are not good names btw - they're just placeholders
Stormwolf is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 05:52 PM.


Overclock.net is a Carbon Neutral Site Creative Commons License Internet Security By ControlScan

Terms of Service / Forum Rules | Privacy Policy | Advertising | Become an Official Vendor
Copyright © 2008 Shogun Interactive Development. Most rights reserved.
Page generated in 0.20000 seconds with 10 queries