Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,749 members, 7,824,156 topics. Date: Saturday, 11 May 2024 at 01:01 AM

C++ Tutorial For Beginners... Part 1... - Programming (5) - Nairaland

Nairaland Forum / Science/Technology / Programming / C++ Tutorial For Beginners... Part 1... (19002 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 okeys112(m): 10:39am On Nov 08, 2014
#Up4Sale

Used White Samsung S4 Zoom

Used Black Coloured BlackBerry Z10 with Box and Charger.

Used Black Coloured BlackBerry Q10 with Box + Charger + Ear Piece

Are U Interested?!

Call 08063525691 or ping pin:2BCC84B1
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 10:47am On Nov 08, 2014
codemarshal08:
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 ! grin








hey brother.... thanks a lot...

1. bro... the A, B, C. variables wilp be Entered by the Student...

remember their valves are A=5, B=4, C=3.... etc... which was defined in the program... so, when the programs asks for let's say "Algorithm = ?"... you will input 5 if you had an "A" or 4 if you had a "B"..

2. yeah, the best variable to use is "interger " not " double" i will make dat correction...


3. lmao... no vex na big mistake on my part oh... i been type this codes off-head yesterday n didn't use my outline. so its Algorithm not Algorithms...

4. Workload is the total sum of the credit unit offered by the student.. by default, workload = 21 ( because each course was 3 unit so 7 course imples ( 3+3+3+3+3+3+3 = 21)..

5.. bro, this is a static program structure not dynamic... if i started with dynamic it would even appear more obsecure... lol... i only assumed the student offered all courses above.. but in situations the student offered less/ more dan 21... then i would ask him/her to enter his/her total workload....

6. Mehn i really appreciate your input bro... i will make corrections asap...( else, syntax error)...


to the general public.... ensure you test these codes.. you cant be a good programmer if you don't practise what you've learnt... thank you...





2 Likes

Re: C++ Tutorial For Beginners... Part 1... by Nobody: 10:54am On Nov 08, 2014
Pls don't forget to like and share with your friends.... let's all learn together and enjoy..

3 Likes 1 Share

Re: C++ Tutorial For Beginners... Part 1... by shilees(f): 4:42pm On Nov 09, 2014
thanks everyone i have installed my compiler, my first program did not run so i left it,I will continue later in d day.
Re: C++ Tutorial For Beginners... Part 1... by codemarshal08(m): 6:15pm On Nov 09, 2014
shilees:
thanks everyone i have installed my compiler, my first program did not run so i left it,I will continue later in d day.

Nice move, Keep learning.. Wish u the best !
Re: C++ Tutorial For Beginners... Part 1... by shilees(f): 8:15pm On Nov 09, 2014
Hurray My program is running fine now, I notice I dint put
Using namespace std;
and math.h header. Moving on to the next one.I will tell u how it goes wink

1 Like 1 Share

Re: C++ Tutorial For Beginners... Part 1... by Nobody: 9:52pm On Nov 10, 2014
shilees:
Hurray My program is running fine now, I notice I dint put
Using namespace std;
and math.h header. Moving on to the next one.I will tell u how it goes wink


wow... am glad... we are here for you...
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 8:47am On Nov 11, 2014
Ezechinwa:



wow... am glad... we are here for you...
I know this thread is for C++, I just need help with an algorithm for a program.
A program that tells you if a number is even or odd... I don't need the codes, just the algorithm would do.
Re: C++ Tutorial For Beginners... Part 1... by codemarshal08(m): 9:04am On Nov 11, 2014
Preboy:

I know this thread is for C++, I just need help with an algorithm for a program.
A program that tells you if a number is even or odd... I don't need the codes, just the algorithm would do.

Let me Give u a hint :
Any Number that can be divided evenly by 2 is even (i.e without a remainder) Otherwise that number is an Odd Number
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 9:31am On Nov 11, 2014
codemarshal08:


Let me Give u a hint :
Any Number that can be divided evenly by 2 is even (i.e without a remainder) Otherwise that number is an Odd Number
thanks bro... your hint just gave me an idea
Re: C++ Tutorial For Beginners... Part 1... by codemarshal08(m): 9:42am On Nov 11, 2014
Preboy:

thanks bro... your hint just gave me an idea
you are welcome !
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 12:39pm On Nov 11, 2014
[quote author=codemarshal08 post=27909411]

Let me Give u a hint :
Any Number that can be divided evenly by 2 is even (i.e without a remainder) Otherwise that number is an Odd Number[/quote

thnks codemarshal08....
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 12:53pm On Nov 11, 2014
Preboy:

thanks bro... your hint just gave me an idea

using modular will work fine
..
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 3:15pm On Nov 11, 2014
Ezechinwa:


using modular will work fine
..
what's modular?... already finished the program tho
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 4:54pm On Nov 11, 2014
Preboy:

what's modular?... already finished the program tho

i meant modular arithmetic.. is a topic in mathematics.. you can read up ariticles about it online..

it suits your program very well...
can u share your code?
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 8:38pm On Nov 11, 2014
Ezechinwa:


i meant modular arithmetic.. is a topic in mathematics.. you can read up ariticles about it online..

it suits your program very well...
can u share your code?
I'll look it up

Anyway here are the codes
import java.util.*;

public class Main
{
public static void main(String[] args)
{
System.out.print("Enter digit: "wink;

Scanner input = new Scanner(System.in);
int a = input.nextInt();
double b = a / 2.0;
int c = 0;
for (c = 0; c < b; c++);
if (c == b)
System.out.println(a + " is an even number"wink;
else
System.out.println(a + " is an odd number"wink;
}
}

1 Like

Re: C++ Tutorial For Beginners... Part 1... by codemarshal08(m): 7:52am On Nov 12, 2014
Thanks For Sharing Your Code PreBoy grin. But i have a Question o, Are You expecting just a number or Sets of Numbers ? Because i don't think a loop will be Necessary to process a Number. shocked

Note: Am not an Expert, Just my 2cent (i believe we are all here to learn !)

1 Like

Re: C++ Tutorial For Beginners... Part 1... by nnasino(m): 1:18pm On Nov 12, 2014
Oga chinwa, its an honour to know you o, I've learnt a lot from your thread. Nice to meet you here on nairaland. Small world, can't believe you've been here all this while. cheers and keep up the good work. I'm really inspired by your thread and i might just start up one on java. Well done

1 Like

Re: C++ Tutorial For Beginners... Part 1... by nnasino(m): 4:01pm On Nov 12, 2014
Preboy:

I'll look it up

Anyway here are the codes
To find out if a number is even or odd, simply check if there is a remainder. This can be done with the modulus operator. This is what ezechinwa suggested.
I don't understand what your code is doing exactly but i think it's a wrong way to go about it.
Correcting your code we have:
import java.util.*;

public class Main
{
public static void main(String[] args)
{
System.out.print("Enter digit: "wink);

Scanner input = new Scanner(System.in);
int a = input.nextInt();

if( a % 2 == 0)
System.out.println(a + " is an even number"wink;
else
System.out.println(a + " is an odd number"wink;
}
}

Nice job

1 Like

Re: C++ Tutorial For Beginners... Part 1... by Nobody: 7:10pm On Nov 12, 2014
nnasino:
Oga chinwa, its an honour to know you o, I've learnt a lot from your thread. Nice to meet you here on nairaland. Small world, can't believe you've been here all this while. cheers and keep up the good work. I'm really inspired by your thread and i might just start up one on java. Well done

hello bro.. have we met b4?? ( since you said small word)..? lol .. also thanks... am flattered...

1 Like 1 Share

Re: C++ Tutorial For Beginners... Part 1... by Nobody: 8:12pm On Nov 12, 2014
nnasino:

To find the modulus of a number, simply check if there is a remainder. This can be done with the modulus operator. This is what ezechinwa suggested.
I don't understand what your code is doing exactly but i think it's a wrong way to go about it.
Correcting your code we have:
import java.util.*;

public class Main
{
public static void main(String[] args)
{
System.out.print("Enter digit: "wink);

Scanner input = new Scanner(System.in);
int a = input.nextInt();

if( a % 2 == 0)
System.out.println(a + " is an even number"wink;
else
System.out.println(a + " is an odd number"wink;
}
}

Nice job

@nnasino, God bless you bro ... to @preboy... dats even a better way to present it.. the main key to this code can b seen from if ( a % 2==0)... thats d key... of course you must introduce a Class Scanner.. lol.. bro.... thats also y i love java....simple... once again i say thnk you. all..

2 Likes 1 Share

Re: C++ Tutorial For Beginners... Part 1... by nnasino(m): 11:50pm On Nov 12, 2014
Ezechinwa:


hello bro.. have we met b4?? ( since you said small word)..? lol .. also thanks... am flattered...
Boss, it's torti from d department of csc. Nice to see u here.

2 Likes 1 Share

Re: C++ Tutorial For Beginners... Part 1... by Nobody: 11:51pm On Nov 12, 2014
nnasino:

Boss, it's torti from d department of csc. Nice to see u here.

wow... torti... am so glad... thnks bro... happy new semester!!!! your d boss....

1 Like 1 Share

Re: C++ Tutorial For Beginners... Part 1... by Nobody: 12:03am On Nov 13, 2014
I opened this thread , not only share my idea on programming but also reach out to the young & old programmers out there, i also developed my skills too... this will be the end of part 1 , i am preparing my pdf file on other powerful software, which you can download for free.. well school has resumed, so i definately won't find time to update this thread.. so once again i say a big thank you... to the guests and special thanks to those who participated...

3 Likes 3 Shares

Re: C++ Tutorial For Beginners... Part 1... by nnasino(m): 12:08am On Nov 13, 2014
Ezechinwa:


wow... torti... am so glad... thnks bro... happy new semester!!!! your d boss....
thanks, boss I
wish u d same o. u've done a great job and a lot of people appreciate it. cheers. all d best this session boss, cheers

2 Likes 2 Shares

Re: C++ Tutorial For Beginners... Part 1... by Nobody: 12:37am On Nov 13, 2014
Ezechinwa:
I opened this thread , not only share my idea on programming but also reach out to the young & old programmers out there, i also developed my skills too... this will be the end of part 1 , i am preparing my pdf file on other powerful software, which you can download for free.. well school has resumed, so i definately won't find time to update this thread.. so once again i say a big thank you... to the guests and special thanks to those who participated...


wow... thnks alot bro... you really made cpp easy for me... and your writing skill is very good... pls notify us when the pdf file is ready... i can read your write ups any day any time... thank you Ezechinwa!!!
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 12:39am On Nov 13, 2014
my mail address is "Ejekestanley@yahoo.com "... wish you all A's this semester....
Re: C++ Tutorial For Beginners... Part 1... by Nobody: 12:41am On Nov 13, 2014
nnasino:

Boss, it's torti from d department of csc. Nice to see u here.

@toti... i saw ur reply, well, i.must say Futo students are really gud... my cousin finished there too... pls when will you start java?...

1 Like 1 Share

Re: C++ Tutorial For Beginners... Part 1... by codemarshal08(m): 7:03am On Nov 13, 2014
Ezechinwa:
I opened this thread , not only share my idea on programming but also reach out to the young & old programmers out there, i also developed my skills too... this will be the end of part 1 , i am preparing my pdf file on other powerful software, which you can download for free.. well school has resumed, so i definately won't find time to update this thread.. so once again i say a big thank you... to the guests and special thanks to those who participated...
You Have Done well, May God Increase Your Knowledge. Please do Focus on your studies oo.


**Pack His loads , Zooms off to another C++ Thread ** grin #C++Team

1 Like 1 Share

Re: C++ Tutorial For Beginners... Part 1... by nnasino(m): 8:48am On Nov 13, 2014
badboy92:


@toti... i saw ur reply, well, i.must say Futo students are really gud... my cousin finished there too... pls when will you start java?...
Thanks bro, I might start today or latest monday.

2 Likes 1 Share

Re: C++ Tutorial For Beginners... Part 1... by Nobody: 9:12am On Nov 13, 2014
nnasino:

Thanks bro, I might start today or latest monday.

following...bro..

1 Like

Re: C++ Tutorial For Beginners... Part 1... by Nobody: 9:13am On Nov 13, 2014
codemarshal08:

You Have Done well, May God Increase Your Knowledge. Please do Focus on your studies oo.


**Pack His loads , Zooms off to another C++ Thread ** grin #C++Team

lol... thnks bro.... i defi will...

(1) (2) (3) (4) (5) (6) (Reply)

C# - Capturing File Name From A FileUpload Control In Asp.net / Web Based Software Vs Standalone Solution / Simple Code Challenge: C#, Java, C, C++

(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. 47
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.