Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,785 members, 7,956,002 topics. Date: Sunday, 22 September 2024 at 09:00 PM |
Nairaland Forum / Science/Technology / Programming / Learning To Program With Java by the Fulaman (43108 Views)
How To Program Arduino Uno / How To Program With Your Android Phone Using Aide IDE Environment / Which Training Center Can Someone Learn How To Program Quickly (2) (3) (4)
(1) (2) (3) ... (6) (7) (8) (9) (10) (11) (12) ... (16) (Reply) (Go Down)
Re: Learning To Program With Java by the Fulaman by Nobody: 2:02pm On May 08, 2016 |
Fulaman198: Please where can I learn python online for free? |
Re: Learning To Program With Java by the Fulaman by Fulaman198(m): 4:11pm On May 08, 2016 |
Re: Learning To Program With Java by the Fulaman by Nobody: 5:24pm On May 08, 2016 |
Fulaman198: Have been tryna pass the python place at codeacedamy for over 30 mins now and I can't so frustrating with all ther maths equations agh ! I feel like I'm taking maths class check this out below
|
Re: Learning To Program With Java by the Fulaman by codemarshal08(m): 5:32pm On May 08, 2016 |
Sugarhugs:
--When working with strings, you start counting from 0. --- The Question is asking you to assign the fifth letter in MONTY (i.e "Y" to variable "fifth_letter" Something like this: fifth_letter = the fifth letter in MONTY , which is "Y". below is how to do it in code // 4 is the index of the letter "Y" , which is the fifth letter in "MONTY" |
Re: Learning To Program With Java by the Fulaman by Nobody: 5:50pm On May 08, 2016 |
codemarshal08: Abeg I understand am jor, don type Monty tire e no gree work |
Re: Learning To Program With Java by the Fulaman by codemarshal08(m): 5:53pm On May 08, 2016 |
Sugarhugs: Don't give up ok. Do check my Edit. |
Re: Learning To Program With Java by the Fulaman by Nobody: 7:09pm On May 08, 2016 |
Re: Learning To Program With Java by the Fulaman by Nobody: 8:51pm On May 08, 2016 |
codemarshal08: Still. Didn't. Work |
Re: Learning To Program With Java by the Fulaman by Nobody: 8:56pm On May 08, 2016 |
codemarshal08: I will jus learn ruby python is too confusing for now |
Re: Learning To Program With Java by the Fulaman by codemarshal08(m): 9:35pm On May 08, 2016 |
Sugarhugs: Calm down and check my Edit. |
Re: Learning To Program With Java by the Fulaman by Fulaman198(m): 12:03am On May 09, 2016 |
Sugarhugs: Hello Miss, You have to remember that a String is an array of characters. What it is trying to demonstrate is how an array of any type works so let me demonstrate. In any array, the first position of that array is always 0. So let's say for instance we have a String literal (which is just a String) that is "Hello". We already know that String is an array of characters, so the character in the first position (or position 0, is H), position 1 is e, position 2 is l, position 3 is l again, and then position 4 is o. Please keep in mind that each String is comprised of an array of characters or char. Just noticed someone else responded to you, please do check his edit as the proper answer would be: fifth_letter = "MONTY"[4] Please try and see if that works. |
Re: Learning To Program With Java by the Fulaman by Nobody: 5:36am On May 09, 2016 |
Hello guys, is this thread turning into a |
Re: Learning To Program With Java by the Fulaman by Fulaman198(m): 5:59am On May 09, 2016 |
crotonite: LOL no, the Goddess earlier asked some questions about it and being the With that said, I'm just waiting on the others to formulate correct solutions to the problems given, I see there has been an update to one of the answers, I will check it out soon, but right now reading books on machine learning and stuff. So I'll be back later. The next lesson will be about Arrays. So be ready. |
Re: Learning To Program With Java by the Fulaman by Nobody: 6:04am On May 09, 2016 |
AI stuffs i guess. i like AI books but they are so confusing to me.
as 4 arrays, i am everly ready . 1 Like |
Re: Learning To Program With Java by the Fulaman by Fulaman198(m): 6:06am On May 09, 2016 |
crotonite: AI stuff is all about understanding how different algorithms work. Did you study Comp sci in Uni? or if you are in Uni, I recommend Comp sci or Comp Engineering. AI is purely mathematical and algorithmic in my opinion. |
Re: Learning To Program With Java by the Fulaman by Nobody: 6:26am On May 09, 2016 |
I wasn't opportuned to further my studies, and i don't think i ever will (i leave that for 'su kaabe'). i am currently studing(@leisure time) design patterns with java after which i will dive into bot programming with java. i am just so addicted to reading codes and anything that has to with computers during my leisure hours. thanks for this lovely thread. 2 Likes |
Re: Learning To Program With Java by the Fulaman by Fulaman198(m): 6:29am On May 09, 2016 |
crotonite: I urge you and encourage you to go back to school if you ever find the time and money to do so. I know everyone has their reasons and I know you are quite an intelligent individual, so please never give up. It's never too late. I don't know how old you are personally and I know that it is none of my business. But there are reports of men in their 70s getting their degrees and I assume that you are much younger than that. 1 Like |
Re: Learning To Program With Java by the Fulaman by Nobody: 7:20am On May 09, 2016 |
OMG 70'S. Well, i am: ((X<<1)+(105 mod 100)) where x = 100/10. and i am already feeling so old. |
Re: Learning To Program With Java by the Fulaman by Nobody: 8:06am On May 09, 2016 |
Fulaman198: I tried and it didn't work. Abeg let me go with ruby, it seems easier and more detailed |
Re: Learning To Program With Java by the Fulaman by satmaniac(m): 8:26am On May 09, 2016 |
Fulaman198: I am sorry @crotonite, for I am the one holding us back. I finished the corrections based on the advice of oga Fulaman198, since yesterday. I will hasten to post them one after the other, in a separate post, so we could move ahead. Oga, Fulaman198, here is assignment 1 Day 5: import java.util.Scanner; public class Convert{ public static void main(String[]args){ int count=0; int selectedConversionUnit = 0 ; double centimeter; double celsius; double naira; double meter; Scanner stdio = new Scanner(System.in); while(selectedConversionUnit>=0) { System.out.println("Please enter a digit here:" selectedConversionUnit = stdio.nextInt(); count++; switch(selectedConversionUnit){ case 1: System.out.println("Please enter a value in centimeter here:" centimeter = stdio.nextDouble(); System.out.println(centimeter + " " + "Equivalent in inches is:" + " " + centimeter/2.54 + "inches" break; case 2: System.out.println("Please enter a value in meter here:" meter = stdio.nextDouble(); System.out.println(meter + " " + "Equivalent in feets is:" + " " + meter/3.28 + "feets" break; case 3: System.out.println("Please enter a value in Celsius here:" celsius = stdio.nextDouble(); System.out.println(celsius + "C" + " " + "Equivalent in fahreinheits is:" + " " + 32+(9/5)*celsius + "fahreinheits" break; case 4: System.out.println("Please enter a value in Naira here:" naira = stdio.nextDouble(); System.out.println( naira + "Naira" + " " + "Equivalent in Euros is:" + " " + naira/227.96 + "euros" break; case 5: System.exit(0); break; default: } } } } 1 Like |
Re: Learning To Program With Java by the Fulaman by satmaniac(m): 8:31am On May 09, 2016 |
Alternatively, using if-else-if-else flow control statement, assignment 1 Day 5 will look like this: import java.util.Scanner; public class HelloWorld{ public static void main(String[]args){ int selectedConversionUnit = 0; int tries = 0; double centemeter; double cmresult; double metres; double ftresult; double celsius; double clresult; double naira; double nrresult; Scanner stdio = new Scanner(System.in); while(selectedConversionUnit>=0){ System.out.println("please enter a value here:" selectedConversionUnit = stdio.nextInt(); tries++; if(selectedConversionUnit==1){ System.out.println("Enter your value in centemeter here:" centemeter = stdio.nextDouble(); cmresult = centemeter/2.54; System.out.println(centemeter+ " " + " equivalent in inch is " + " " + cmresult + "inches " } else if(selectedConversionUnit==2){ System.out.println("Enter your value in metres here:" metres = stdio.nextDouble(); ftresult =metres/3.28; System.out.println( metres + "equivalent in feet is: " + " " + ftresult + "feets" ); } else if(selectedConversionUnit==3){ System.out.println("Enter your value in Celsius here:" celsius = stdio.nextDouble(); clresult = 32+(9/5)*celsius; System.out.println(celsius + " " + " equivalent in fahreinheits is " + " " + clresult +" " + "fahreinheits." } else if(selectedConversionUnit==4){ System.out.println("Enter your value in Naira:" naira = stdio.nextDouble(); nrresult = naira/227.96; System.out.println(naira + " " + "equivalent in euro is " + " " + nrresult + " " + "euros" }else if(selectedConversionUnit==5){ System.exit(0); } } } } Sorry o! I don develop some kind of bias towards if-else-if-else control statement, so, include am |
Re: Learning To Program With Java by the Fulaman by satmaniac(m): 8:40am On May 09, 2016 |
And the assignment 2 Day 5, I hope I dey right: import java.util.Scanner; import java.lang.Math; public class Guess{ public static void main(String[]args){ int count = 0; int numberGuessed = 0; int randomNumber = (int)((Math.random() * 100) + 1); Scanner stdio = new Scanner(System.in); while(numberGuessed!=randomNumber){ System.out.println("Please guess a number between 1 and 100" numberGuessed = stdio.nextInt(); count++; } System.out.println("You win! After" + " " + count++ + " " + "times" ); } } |
Re: Learning To Program With Java by the Fulaman by Nobody: 10:38am On May 09, 2016 |
Fulaman198: Which maths topics does one need to do programming? Cause I read somewhere programming requires math skills |
Re: Learning To Program With Java by the Fulaman by hardebayho(m): 3:55pm On May 09, 2016 |
This is what I came up with guys.
|
Re: Learning To Program With Java by the Fulaman by hardebayho(m): 5:46pm On May 09, 2016 |
Sugarhugs: I thought you said you were learning html and css? If you're done with those, can you show me some of the websites you've created with those two?. If you don't have any projects created, then I urge you to create some to know how much you know(or how much you don't know) of those two then decide if you want to learn another language. |
Re: Learning To Program With Java by the Fulaman by ANTONINEUTRON(m): 10:29pm On May 09, 2016 |
Sugarhugs:Logic, Flowchart and sliderule. But ur logical sense of solving problem will help u. Algebra And Calculus would be an added advantage. |
Re: Learning To Program With Java by the Fulaman by ANTONINEUTRON(m): 10:40pm On May 09, 2016 |
Sugarhugs: It is not about changing from Python to Ruby. All of them are thesame[C-based languages]. Since u wanna go into Web Development, I'll advice u go with HTML/CSS. If u are done! Go and practice. When praticing, and u are getting better, u should start learning Javascript - Which is a Programming Language. d fun part of learning Javascript at thesame time practicing HTML is dat Javascript code are implemented in HTML - <script></script> tag - which help u getting familiar with Html mre and mre. If u are good with d three languages [HTML/CSS/JAVASCRIPT]. U can learn a scripting languages like python, Ruby, php, asp.Net e.t.c. What will make ur learning of any scripting language fun is the knowledge of Javascript u earlier had. So what u will nid to strt creating Web Apps with the scripting languages is their framework like Django(python), Ruby on Rails(Ruby) e.t.c Wit knowledge of a SQL u re good 2 go!! |
Re: Learning To Program With Java by the Fulaman by Nobody: 11:27pm On May 09, 2016 |
ANTONINEUTRON: Aiit thanks, already working on it. |
Re: Learning To Program With Java by the Fulaman by satmaniac(m): 5:41am On May 10, 2016 |
ANTONINEUTRON: Good morning everybody Oya make una wake up, I see teacher dey come class. Shebi na 2day in dey teach us arrange....sorry...erm...wetin be the name self....hit head and stamp feet on the ground...Ok now I don get am. Array. So dis guy too don tey for the game. Thumb up bro. Come o! This one wey our teacher never show face so, hope say that fine lady never carry her feet match our teacher face o Bia, Sugarhugs, come explain yasef before we pronounce you guilty. You know say, the instruction was to put feet on his face, no go match our oga face o |
Re: Learning To Program With Java by the Fulaman by Nobody: 6:35am On May 10, 2016 |
This not to derail the thread,but it is rather good to share knowledge, there was a time i was hell-bent on solving simultaneous equations(2 sets and 3 sets) with Java, all the code i saw online were to cumbersome, so what i did was that, i took my mathematics textbook,i did some derivations and i programmed the steps,elimination method to be precise,used in the textbook; i added few exceptions just in case u get a value like (2/0 or y/0 or x/0); i include that also in the program . Lemme share the code with you guys,it is my own personal code. i will share 3 equations later. this is for 2 equations package beginner; import java.util.Scanner; class newbie{ public static void main(String args[]){ double a1,a2,b1,b2,c1,c2,x,y; Scanner UserInput = new Scanner(System.in); //takes all user inputs int m = 0; while( m == 0){ System.out.println("Enter the value of a1: " a1 = UserInput.nextFloat(); System.out.println("enter the value of b1: " b1 = UserInput.nextFloat(); System.out.println("Enter the value of c1: " c1 = UserInput.nextFloat(); System.out.println("enter the value of a2: " a2 = UserInput.nextFloat(); System.out.println("Enter the value of b2: " b2 = UserInput.nextFloat(); System.out.println("enter the value of c2: " c2 = UserInput.nextFloat(); x = (c2 - ((b2/b1)*c1))/(a2 - ((b2/b1)*a1)); //evaluates x and y y = (c2 - ((a2/a1)*c1))/(b2 - ((a2/a1)*b1)); if(Double .isNaN(x)) //if x is a value like infinity or undefined,use another method to calculate x; { x = (c1 - (b1*y))/a1; if(Double .isNaN(x)){ x = (c2 - (b2*y))/a2; } else{} } else { } if (Double .isNaN(y)) //if y is a value like infinity or undefined,use another method to calculate y; { y = (c1 - (a1*x))/b1; if (Double .isNaN(y)){ y = (c2 - (a2*x))/b2; } else{} } else { } System.out.print("x = " //print results System.out.println(x); System.out.print("y = " System.out.println(y); } } } |
Re: Learning To Program With Java by the Fulaman by Fulaman198(m): 7:34am On May 10, 2016 |
Sugarhugs: Hello dear, some aspects of programming does, especially gaming programming and understanding recursion. This is simply more advanced programming. For instance, if I wanted to write a while loop which would take 15 lines of code, I can probably do it in 5 lines of code with Recursion. Some aspects of programming (especially if you ever take a data structures and algorithms class) requires understanding of Discrete Structures and Linear Algebra. If you ever get involved in advanced 3D games programming, you would want a good understanding of physics and calculus. BTW, here is another link for Python, I hope that you have better luck with this: https://www.coursera.org/learn/python/home/welcome |
Re: Learning To Program With Java by the Fulaman by Fulaman198(m): 7:38am On May 10, 2016 |
@Antonineutron and @the comedian satmaniac lol I will grade your assignments hopefully before tomorrow, I'm caught up in a storm of stuff right now. Please bare with me, I will hopefully have them graded no later than Wednesday. 1 Like |
(1) (2) (3) ... (6) (7) (8) (9) (10) (11) (12) ... (16) (Reply)
Sultan Akintunde Set For Guinness World Record For Longest Software Coding Time / What Are The Best Laptops For Programmers And Hackers?! / Basil Okpara Jr, Biography, Age, Nigerian Programmer Who Built 30 Mobile Games
(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. 81 |