Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,198,080 members, 7,967,017 topics. Date: Saturday, 05 October 2024 at 10:00 AM |
Nairaland Forum / Science/Technology / Programming / C++ Tutorial For Beginners... Part 1... (19504 Views)
C++ Tutorial Download Link / Java Tutorial For Beginners / Free C++ Tutorial Videos (2) (3) (4)
(1) (2) (3) (4) (5) (6) (Reply) (Go Down)
Re: C++ Tutorial For Beginners... Part 1... by shilees(f): 2:06am On Nov 01, 2014 |
Wow I love this thread, have lost touch with my programming skills but seeing all the work here I think am back.great job. I will install my compiler tomorrow morning and join the class full time.as for ladies not participating,we prefer fashion thread |
Re: C++ Tutorial For Beginners... Part 1... by Shuayb0(m): 9:09am On Nov 01, 2014 |
Bro, u re doing a gr8 job here. However my code (from ur examples)ws unable to compile stating an error in dqinclude line, pls help wth dis. Gracias. |
Re: C++ Tutorial For Beginners... Part 1... by codemarshal08(m): 10:01am On Nov 01, 2014 |
Shuayb0:can u post the code u tried to run here ? |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 10:01pm On Nov 01, 2014 |
shilees: nice.. just take your time sis..... guys... i took a break cuz i wasn't really impressed with the low responds i was getting... but am back... stay tuned as we deal with our first project.... |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 10:03pm On Nov 01, 2014 |
Shuayb0: bro, pls kindly post ur code here.. let's break it down... thank you bro.. |
Re: C++ Tutorial For Beginners... Part 1... by Shuayb0(m): 11:45am On Nov 02, 2014 |
Ezechinwa:1 #include <iostream > 2 using namespace std; 3 4 int main () { 5 int x = 6; 6 7 switch (x){ 8 case1: 9 cout << "x is 1\n"; 10 break; 11 case2: 12 case3: 13 cout << "x is 2 or 3\n"; 14 break; 15 default: 16 cout << " x is not 1,2 or 3\n"; 17 18 return 0 19 } Its always displaying the error code. Line 1 parse error before numeric, parse error before ‘#’ token. |
Re: C++ Tutorial For Beginners... Part 1... by obioraval(m): 12:43pm On Nov 02, 2014 |
@ OP, this is superb. C++ made easy. Following with keen interest |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 7:41pm On Nov 02, 2014 |
Shuayb0: Hello guys... before we proceed to the Gpa project, let's help our brother ShuagbO here... Solution to the above problem.... Dear Shuagb.... let's review your program... you see, from what you wrote, the nature of your program is displaying an output from four possible options.... 1. #include <iostream> 2. #include <cstdio> 3. #include <math.h> 4. 5. using namespace std; 6. int main() 7. { 8. int x ; // comment : don't define x = 6, 9. cout << "Enter a Number : /n" ; 10. cin >> x ; // the user enters a number... 11. // apply your switch statement 12. switch (x) 13. { 14. case 1 : // you wrote "case1:" instead of " case 1:" 15. cout << " x is 1 \n" ; 16. break ; // case 1 terminates here... 17. case 2 : // you made the same error sir.. 18. cout << "x is 2 \n" ; 19. break ; // case 2 Terminates here... 20. case 3 : // once again, an error, don't write case3: but " case 3: ".... 21. cout << " x is 3 \n"; .... 22. break; // case 3 Terminates here..... 23. default : 24. cout << " Oboy the numbers you enter no dey here oh " 25. break; // close the braces } 26. system (" PAUSE" ; // OGA, ABEG ALWAYS PUT THIS COMMAND IN YOUR PROGRAMS...OK.. 27. return 0; } 1 Like |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 7:41pm On Nov 02, 2014 |
obioraval: thnks bro... highly appreciated... |
Re: C++ Tutorial For Beginners... Part 1... by Excel23: 8:19am On Nov 03, 2014 |
ride on Boss, I am with u 1 Like |
Re: C++ Tutorial For Beginners... Part 1... by dueal(m): 3:14pm On Nov 03, 2014 |
Hi, i got info that www.kuluya.com will be needing a game developer who can or will be working with the Lua scripting language to develop games for Android using their framework. Requirements: You should be able to learn the Lua scripting language if you don't know about it already. if you are interested then contact: dueal21@yahoo.co.uk with the heading...Lua game dev...please don't dumb spam |
Re: C++ Tutorial For Beginners... Part 1... by Shuayb0(m): 9:28am On Nov 04, 2014 |
Ezechinwa:Fanks for the correction bro, apart from d mistakes wth d cases, does it mean if I include dose three headerfiles, d program wud execute fine. You re doing an amazing work I swear. Gracias. |
Re: C++ Tutorial For Beginners... Part 1... by shilees(f): 3:29pm On Nov 04, 2014 |
Please house,Is there a way I can download the compiler with my phone and then install it on my computer 'cos my computer is not connected, and have not been able to practice.I use a blackberry.thanks |
Re: C++ Tutorial For Beginners... Part 1... by codemarshal08(m): 3:35pm On Nov 04, 2014 |
shilees: You can if U have enough data.. Code Blocks is about 90+ Mb in size. Alternatively, you could transfer from a friend's pc to yours. |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 9:08pm On Nov 04, 2014 |
shilees: sis... its simple... you can download it on mobile, take note of the directory you saved the file... then connect your USB between the pc and mobile.... from my computer... ( Ensure you save it on your SD card) |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 9:11pm On Nov 04, 2014 |
Shuayb0: bro, with or without the added header files , your program should run smoothly.... i only do dat not to forget my header files lol.... so, did you compile the codes?? cause i havent...? |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 9:13pm On Nov 04, 2014 |
codemarshal08: nice one bro... |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 12:00pm On Nov 06, 2014 |
Ezechinwa:I hope the tutorials are still going 1 Like 1 Share |
Re: C++ Tutorial For Beginners... Part 1... by kbshow100(m): 1:54pm On Nov 06, 2014 |
Thank you op. |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 11:59pm On Nov 06, 2014 |
Preboy: i will try my best before my sch resumes... try to finish part 1 at least before next week... also, need you guys to keep up d gud work... |
Re: C++ Tutorial For Beginners... Part 1... by Olurote(m): 3:19pm On Nov 07, 2014 |
enjoyed this write up. Interested more in android development 1 Like |
Re: C++ Tutorial For Beginners... Part 1... by Shuayb0(m): 6:03pm On Nov 07, 2014 |
Ezechinwa:Boss we are following u lk kilode, pls continue d gud work. 1 Like |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 10:56pm On Nov 07, 2014 |
will update in 30 mins... |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 11:00pm On Nov 07, 2014 |
BRO your doing an Excellent job... C++ has never been dis interesting...... My lord will bless you.... |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 11:01pm On Nov 07, 2014 |
Ezechinwa: front sit..... |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 11:15pm On Nov 07, 2014 |
Hello guys, sorry for keeping you waiting... well, i want to use this medium to thank you guys for your constant support towards keeping this thread alive.... back to business.... so far, we have been able to learn the basics of C++ and understand that writing a program just requires logical thinking and properly following the simple rules/ syntax of C++... THE MOMENT WE ALL HAVE BEEN WAITING FOR....(( YOUR FIRST PROJECT>> GPA CALCULATOR))...... the time is right to handle your first major project... and as usual we start by breaking down the problem using an outline approach... here are the outlines below... PROJECT;;; Write a simple program on cplusplus capable of determining a students grade point avarage (gpa)... use the following information Grading system =( A=5 , B=4, C=3 , D =2 , E=1, F=0) GPA system; 5.0 Department : Computer science Level ; 400 level Courses offered and unit: 1 Operations research = Mth 401 (3-unit) 2 Numerical analysis = Mth 421 (3-unit) 3 Programming = Csc 401 (3-unit) 4 Database = Csc 411 (3 unit) 5 Computer and society = Csc 421 (3 unit) 6 Algorithm = CSC 431 ( 3 unit) 7 Oracle = Csc 441 (3 unit) total unit = 21. |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 11:53pm On Nov 07, 2014 |
Ezechinwa: Solution........ given the following parameters above, let's break this problem... SOLUTION... // PART 1: INCLUDE HEADER FILES #include <iostream> #include <cstdio> #include <cstdlib> using namespace std; int main () { //part 2... make we define our parameters now... // MAKE WE DEFINE OUR GRADES, WORKLOAD, SUM, AND OUTPUT =GP int A ; int B ; int C ; int D ; int E ; int F ; int sum ; int WORKLOAD ; double GP ; // leave GP as double not Int A=5; B=4; C=3; D=2; E=1; F=0; WORKLOAD = 21; // REMEMBER OUR WORKLOAD IS 21... // DEFINE OUR COURSE CODES double MTH421 ; double MTH401 ; double CSC401 ; double CSC411 ; double CSC421 ; double CSC431 ; double CSC441 ; // TIME TO ASSIGN EACH UNIT TO THE COURSE CODE ; MTH421= 3; MTH401= 3; CSC401= 3; CSC411= 3; CSC421= 3; CSC431= 3; CSC441= 3; //TIME TO ASSIGN THE RESPECTIVE COURSE NAME ; double NUMERICAL_ANALYSIS ; double OPERATIONS_RESEARCH ; double PROGRAMMING ; double DATABASE ; double COMPUTER_AND_SOCIETY ; double ALGORITHM; double ORACLE ; // INPUT THE GRADES FOR THE FOLLOWING COURSES ; cout << "INPUT YOUR GRADES HERE"; cout << "NUMERICAL ANALYSIS = " ; cout << " " ; cin >> NUMERICAL_ANALYSIS; cout << "OPERATIONS RESEARCH = " ; cout << " " ; cin >> OPERATIONS_RESEARCH; cout << "ALGORITHM = " ; cout << " " ; cin >> ALGORITHM; cout << "COMPUTER AND SOCIETY = " ; cout << " " ; cin >> COMPUTER_AND_SOCIETY; cout << "PROGRAMMING = " ; cout << " " ; cin >> PROGRAMMING; cout << "DATABASE = "; cout << " " ; cin >> DATABASE ; cout << "ORACLE = "; cout << " " ; cin >> ORACLE; //PRODUCE THE MATHEMATICAL FUNCTIONS AND THEIR RELATION; //PART 3 DO SOME MATHEMATICAL OPERATIONS... sum <= 105 ; // CONDITIONAL STATEMENT ( IF THE STUDENT GETS ALL A's ) sum = (NUMERICAL_ANALYSIS * MTH421)+(OPERATIONS_RESEARCH * MTH401)+( PROGRAMMING * CSC401 )+(ALGORITHM* CSC431)+(COMPUTER_AND_SOCIETY * CSC421)+(ORACLE * CSC441)+(DATABASE *CSC411) ; GP = ( sum / WORKLOAD ) ; cout << "YOUR CURRENT GPA FOR 400 LEVEL 1ST SEMESTER IS =" ; cout << endl; cout << " " ; cout << endl; cout << GP ; cout << endl; cout << endl; cout << endl; cout << "THIS PROGRAM WAS CREATED BY EZECHINWA " ; cout << endl; cout << "SCHOOL: FUTO(OWERRI).....REG NUMBER : 2010XXXXXXXXX" ; cout << endl; cout << "DEPT : COMPUTER SCIENCE " ; cout << endl; cout << endl; system ("PAUSE" ; return 0 ; system ("PAUSE" ; return 0 ; } 1 Like |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 11:58pm On Nov 07, 2014 |
Drop your questions here... |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 12:18am On Nov 08, 2014 |
Ezechinwa:When is the Java version going to kick off? C++ is just way too complicated for me, though I like your algorithms 1 Like |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 1:40am On Nov 08, 2014 |
Preboy: Am thinking about creating a pdf book on Java and andriod app development.. then include my email address to it for feedbacks n questions... download will be Free... |
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 1:42am On Nov 08, 2014 |
Ezechinwa:That's a great idea... God bless bro 1 Like |
Re: C++ Tutorial For Beginners... Part 1... by codemarshal08(m): 6:48am On Nov 08, 2014 |
Nice Work EZE, I can see u tried to Make it simple as Possible. However u need to work on the points Below : 1) I can't see where you used the Variables A, B C......... OR am not getting your logic ? 2)Why are You using Double type for variable A, B C... when you are not expecting a decimal value 3)In Line 77 & line 100 , u have ALGORITHMS(I guess u mean to write ALGORITHM), i know it is typing error . 4)I don't think using UPPERCASE in naming variable is a good practice 4)What is WorkLoad ?? why 21 ? most beginners will be confused. why not be more descriptive in your Object naming and Values e.g tcu (Total credit Unit) =(3+3+3+3+3+3+3) Addition of all the course units. 5)I thought Work Load is suppose to be derived from Line 44 - 50 ?? Why den does WorkLoad Definition Come B4 those lines (i know it does not matter but Newbies could enter Thinking Mode o, u know)... 6) Note: I am not Perfect, just my 2cent ! Keep it up bro ! 1 Like |
(1) (2) (3) (4) (5) (6) (Reply)
Pros And Cons Of Dating A Programmer Or Just A Geek / I Just Bombed A Technical Interview / How Much Do Web Developers Earn In Nigeria?
(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. 63 |