Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,329 members, 7,954,332 topics. Date: Friday, 20 September 2024 at 04:50 PM |
Nairaland Forum / Science/Technology / Programming / C++ Beginner Discussion Room: Drop Your Codes (11773 Views)
I Want To Hire A Beginner Who Is Willing To Learn New Skills / Special Codes To Format Text On Nairaland / Should A Beginner Learn 2 Programming Languages At Once? (2) (3) (4)
(1) (2) (3) (4) (5) (Reply) (Go Down)
Re: C++ Beginner Discussion Room: Drop Your Codes by adelolaa(m): 11:10am On Dec 25, 2013 |
Kennybix: @ade, can you handle structures? You can use it to 'hold' fractions, and pass it as an argument to functions. It can even be used as a return type! thanks. I will use class |
Re: C++ Beginner Discussion Room: Drop Your Codes by quadrangle: 1:32pm On Dec 27, 2013 |
here is my code. //Program: checkbook.cpp //This program updates a checkbook #include <iostream> #include <iomanip> using namespace std; int main () { char trans_type; double start_bal, trans_amt, end_bal; //Module for getting data cout << "Enter your starting balance and press <Enter>" <<endl; cin >> start_bal; cout << "Enter your starting balance and press <Enter>" <<endl; cin >> trans_amt; cout << "Enter your trans_type 'W' (withdrawal) or 'D' (Deposit) and press <Enter>" <<endl; cin >> trans_type; // Perform computation if(start_bal == 'w') { end_bal = start_bal - trans_amt; } else { end_bal = start_bal + trans_amt; } //Print result cout << "Starting balance is " << start_bal << endl; cout << "Transaction amount is " << trans_amt << setw(2) << trans_type << endl; cout << "Ending balance is " << end_bal << endl; } 1 Like |
Re: C++ Beginner Discussion Room: Drop Your Codes by adelolaa(m): 3:00pm On Dec 27, 2013 |
quadrangle: here is my code. nice work |
Re: C++ Beginner Discussion Room: Drop Your Codes by adelolaa(m): 3:01pm On Dec 27, 2013 |
/* write a program that ask the user to enter his or her age. then display the age in months */ #include <iostream> using namespace std; void age_in_month(int); int main() { int age; cout << "Enter your age: "; cin >> age; age_in_month(age); } void age_in_month(int initial) { int month = initial * 12; cout << initial << " year(s) of age(s) is " << month << " months"; } |
Re: C++ Beginner Discussion Room: Drop Your Codes by techwizard(m): 11:18pm On Jan 01, 2014 |
#include <iostream> #include <windows.h> using namespace std; int main(void){ start: cout << "Welcome to coded admin login\n" << endl; cout << "Login using your administrator password:" << endl; string login; getline (cin, login); if (login == "yourPassword"{ ShellExecute(NULL, "open", "http://www.highlycoded.com", NULL, NULL, SW_SHOWNORMAL); return 0; } else { cout << "Login failed" << endl; goto start; } cin.get(); return 0; } 1 Like |
Re: C++ Beginner Discussion Room: Drop Your Codes by wisemania(m): 7:52pm On Jan 02, 2014 |
techwizard: #include <iostream> |
Re: C++ Beginner Discussion Room: Drop Your Codes by Nobody: 12:14am On Jan 03, 2014 |
Was going thru my archive, just tot I drop the codes for a guessing game I wrote as a beginner |
Re: C++ Beginner Discussion Room: Drop Your Codes by Nobody: 12:15am On Jan 03, 2014 |
#include <iostream> #include <cstdlib> #include <string> #include <ctime> using namespace std; int usernum, compnum, playagain; void gamestart(){ int quit, level; cout << endl; cout << " GUESSING GAME!!! " << endl<<endl; cout << " to continue press 1 " << endl; cout << " to end the game press 2 " << endl; cin >> quit ; if (quit == 2){ cout << " gooood byee " ; } if (quit == 1){ cout << endl; cout << " enter any difficulty level btw 1 and 1000" << endl; cin >> level; cout << endl; cout << " hmmm... level " << level << " selected , let the game begin!! " <<endl<<endl; cout << " computer is thinking of a number btw 1 and " << level << endl; cout <<" try and guess what number it is " << endl; cin >> usernum; compnum = rand()% level; } } void game (int usernum, int compnum){ while (usernum!=compnum){ if (usernum < compnum ){ cout << " your guess is to low , please try again " << endl<< endl; cout << ">> "; cin >> usernum; } if ( usernum > compnum ) { cout << " your guess is to high , try again " << endl<< endl; cout << ">> "; cin >> usernum; } } if (usernum == compnum){ cout << " congrats , you win!!! " << endl; cout << " press 1 to play again " << endl; cout << " press 2 to quit " << endl; cin >> playagain ; } if(playagain == 1){ gamestart(); game (usernum, compnum); } else { cout << " gooood byee " ; } } int main (){ srand(time(NULL)); gamestart(); game (usernum, compnum); } |
Re: C++ Beginner Discussion Room: Drop Your Codes by Borwe: 2:55pm On Jan 03, 2014 |
adelolaa: screenshots how did you do that exactly? What app is it ? And what's the procedure ? |
Re: C++ Beginner Discussion Room: Drop Your Codes by Olyboy16(m): 12:20am On Jul 27, 2014 |
raynold: I kinda(not like a pro) knw c, c++ and javajust like saying u ar a footballer but you dont like scoring! |
Re: C++ Beginner Discussion Room: Drop Your Codes by raynold(m): 12:15pm On Jul 27, 2014 |
Olyboy16:lol... am improving every day even with the very little time I have to practice.. 1 Like |
Re: C++ Beginner Discussion Room: Drop Your Codes by losprince(m): 7:06pm On Jul 27, 2014 |
iamDemigod: #include <iostream>quite creative |
Re: C++ Beginner Discussion Room: Drop Your Codes by Artorius(m): 1:22am On Sep 17, 2014 |
Hello guys, well the thread is in hibernation; sorry to disturb I'm learning c++, and I'm wondering how I can execute c++ codes on my android device. Yea I saw one or two posts on the thread about using c4droid, after installing I was directed to also install gcc and sdl which I also did. But it's as if the gcc app isn't integrated into the c++ or something like that. Even when I try to fix that in the c4droid preferences, I'm still directed to install the gcc plugin which I have already! Can somebody please give me tips on how to fix this? I'll be most grateful, and I'll sure be coming back to ask more questions, thanks. |
Re: C++ Beginner Discussion Room: Drop Your Codes by raynold(m): 8:31am On Sep 18, 2014 |
Artorius: Hello guys, well the thread is in hibernation; sorry to disturb I'm learning c++, and I'm wondering how I can execute c++ codes on my android device. Yea I saw one or two posts on the thread about using c4droid, after installing I was directed to also install gcc and sdl which I also did. But it's as if the gcc app isn't integrated into the c++ or something like that. Even when I try to fix that in the c4droid preferences, I'm still directed to install the gcc plugin which I have already! Can somebody please give me tips on how to fix this? I'll be most grateful, and I'll sure be coming back to ask more questions, thanks.download the c4droid from the playstore(payed tho).. |
Re: C++ Beginner Discussion Room: Drop Your Codes by Borwe: 2:46pm On Sep 20, 2014 |
raynold: download the c4droid from the playstore(payed tho).. There us CCTools-free. It's free. Only thing is it downloads packages on first run. about 50mb. |
Re: C++ Beginner Discussion Room: Drop Your Codes by AptechWorld: 8:13pm On Sep 21, 2014 |
Friends, Information and Communication Technology (I.C.T) is ushering in a new Economic Order. It has become a necessity and the earlier you position yourself by gathering the needed skills-set the better. The days when some selected disciplines were considered the gold standard are done for good. No matter your profession, harnessing the gains of Information Technology Infrastructure for organizational profitability is the relevant subject in boardrooms across the globe. You must have heard of the new guys at the Board Room...The C.T.O(Chief Technology Officers)! Soon they will be chairing the Board because they are increasingly becoming indispensable. Aptech is training and raising a generation of I.T professionals that will set the pace and engineer the future. Ben Work: +234 817 212 2383 Mobile: +234 803 796 6539 Website: www.stplglobal.com Address: 57A, Adeola Odeku Street, Victoria Island, Lagos, Nigeria “It is by meeting the Noble standards you have set for yourself that self is enhanced” |
Re: C++ Beginner Discussion Room: Drop Your Codes by Nobody: 3:39pm On Sep 22, 2014 |
adelolaa: /******************************** if they are off the same age |
Re: C++ Beginner Discussion Room: Drop Your Codes by Sirnuel: 3:03pm On Sep 28, 2014 |
wisemania: Pls can u e-mail links to those your e-books?? Especially the ones on c and hacking <a href="www.sirnuell@gmail.com"<MY Email</a> |
Re: C++ Beginner Discussion Room: Drop Your Codes by olaoreAd: 9:27am On Oct 03, 2014 |
I'm happy to see my fellow c++ visionaries here, and I have created a group on whatsapp where we can talk on better and improved project on c++. To join the group simply comment with ur phone number or add me with 07036792585 and ur first message should me c++ visionary. Together we can make Nigeria proud. |
Are You On The Dark Web? / Can You Write Codes With A Tablet Instead Of A Laptop? / Foreign Jobs(remote And Relocation) Discussions
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 65 |