User | Post |
Wopple
Posts: 2/41 |
Originally posted by HyperHacker DOS is useful when Windows crashes and you don't want to lose a lot of your stuff.
A Linux boot is more usefull =-P |
FloBo
Posts: 86/101 |
Erm... knoppix supports read-only NTFS. write-mode is still quite buggy. Only barts windows pe can write ntfs properly... but you may just convert your partitions to fat32. this works very well under linux^^ |
Dish
Posts: 551/596 |
No -- get rid of that background. That's a terrible background for a post layout. |
Zer0wned
Posts: 50/181 |
Disch, you reek of awesome. Thanks again. I'm done with questions for a while *goes back to the tutorials*
(btw, the text is fairly readable on this background, right? it seemed like the most readable color) Edit: Oh well... |
Dish
Posts: 550/596 |
if(number_of_quarters != 0) cout << number_of_quarters << " quarters."; |
Zer0wned
Posts: 49/181 |
Alright, I finished my program. Now I have it so that you can put any amount you want for cost and amount paid, it will then calculate out the change, and give you the amount of bills/coins needed.
Which brings me to a new question: How can I get it so that when the values=0, I can omit that output? (so I don't get all this quarters= 0, dimes= 0 clutter)
And knoppix linux supports NTFS natively!? Sweet, I was considering adding a linux OS to my computer (and learning how to use it ), but most of my stuff is in NTFS, which would kind of ruin it for me. *googles knoppix-linux*
|
FloBo
Posts: 85/101 |
additionally, you may consider using barts pe-builder or any knoppix-linux to save your data when windows refuses to work... with barts pe, you even have native windows-ntfs support with complete read/write access and support for usb-mounting etc.
so there's no REAL reason to use dos anymore, unless your computer is veeeeeeery old^^ |
Zer0wned
Posts: 47/181 |
Yup, that worked, thanks. Now to add bills!
And as for calling it DOS, it's a bad habit, I see that black and white text and that's what comes to mind.
*Repeats "Commandline isn't always DOS" in head*
@Hyperhacker I can't remember one time I've ever managed to save my stuff with DOS... it was always too late T_T |
HyperLamer
Posts: 6720/8210 |
DOS is useful when Windows crashes and you don't want to lose a lot of your stuff. |
Dish
Posts: 549/596 |
First of all... Console != DOS. There is no reason why you should be coding for DOS, it's a dead OS. In all likelyhood you're coding for windows, albiet commandline.
That aside -- you could accomplish this by putting the main program inside of a loop -- something like:
void DoProgram() { //ask for price and calculate and print change here }
int main() { char answer; do { DoProgram(); cout << "Exit? y/n"; cin >> answer; }while(answer != 'y');
return 0; }
My code might be a little off as I'm not very familiar with cin/cout (I hate console) -- but it gives the general idea. The Do-While loop will run the contents once, then check to see if they typed 'y' at the final prompt -- if they did, the loop will exit and the program will close. Otherwise the loop will continue, asking for the price and whatever all over again. |
Zer0wned
Posts: 46/181 |
For learning purposes, I'm making a little DOS program that calculates proper change (how many dimes, nickels, pennies, etc.) from $1. Say something costs 7 cents, it returns as: 3 quarters 1 dimes 1 nickels 3 pennies
Right now I alls have to prevent it from shutting immediately if you double-clicked it in windows is this command at the end, which makes a useless prompt
int k; cout << "See!? it didn't close!"; cin >> k;
I want it to return to the prompt asking for price in the beginning instead of closing the program or just stalling at a prompt like I made it do. Like a branching prompt:
Exit? y/n ^^--like so, so if I were to enter "n" I'd be brought back to the beginning
If neccessary I can post the source code (it's only like 30 lines) |