Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,295 members, 7,808,003 topics. Date: Thursday, 25 April 2024 at 02:19 AM

Learning To Program With Java by the Fulaman - Programming (9) - Nairaland

Nairaland Forum / Science/Technology / Programming / Learning To Program With Java by the Fulaman (41322 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:


Na so? I'm very proud and happy for you grin grin grin grin, you will definitely excel at Cascade Style Sheets cheesy


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
Sugarhugs:



Please where can I learn python online for free?

Here you go: http://www.learnpython.org/
Re: Learning To Program With Java by the Fulaman by Nobody: 5:24pm On May 08, 2016
Fulaman198:


Here you go: http://www.learnpython.org/


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:



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

+---+---+---+---+---+
| M | O | N |T | Y |
+---+---+---+---+---+
0 1 2 3 4

--When working with strings, you start counting from 0.
--- The Question is asking you to assign the fifth letter in MONTY (i.e "Y"wink 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


fifth_letter = MONTH[4] use fifth_letter = "MONTY"[4] // i am sorry for the mistake! 

// 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:


You seem not to understand the Question asked

Abeg I understand am jor, don type Monty tire e no gree work cry cry
Re: Learning To Program With Java by the Fulaman by codemarshal08(m): 5:53pm On May 08, 2016
Sugarhugs:


Abeg I understand am jor, don type Monty tire e no gree work cry cry

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
codemarshal08:


Don't give up ok. Do check my Edit.


OK thanks kiss will check it when I'm back home
Re: Learning To Program With Java by the Fulaman by Nobody: 8:51pm On May 08, 2016
codemarshal08:


+---+---+---+---+---+
| M | O | N |T | Y |
+---+---+---+---+---+
0 1 2 3 4

--When working with strings, you start counting from 0.
--- The Question is asking you to assign the fifth letter in MONTY (i.e "Y"wink 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


fifth_letter = MONTH[4]
// 4 is the index of the letter "Y" , which is the fifth letter in "MONTY"





Still. Didn't. Work
Re: Learning To Program With Java by the Fulaman by Nobody: 8:56pm On May 08, 2016
codemarshal08:


Don't give up ok. Do check my Edit.


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:



I will jus learn ruby python is too confusing for now

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:



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

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 snake thread python from java? i am ophidiophobic, just the mention of snake or anything that has to do with it can make me vacate this thread speedily (@mach 5) grin.
Re: Learning To Program With Java by the Fulaman by Fulaman198(m): 5:59am On May 09, 2016
crotonite:
Hello guys, is this thread turning into a snake thread python from java? i am ophidiophobic, just the mention of snake or anything that has to do with it can make me vacate this thread speedily (@mach 5) grin.

LOL no, the Goddess earlier asked some questions about it and being the foot slave/boy the gentleman that I try to be towards beautiful women, I tried to be courteous and answer the question(s).

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 wink.

1 Like

Re: Learning To Program With Java by the Fulaman by Fulaman198(m): 6:06am On May 09, 2016
crotonite:
AI stuffs i guess. i like AI books but they are so confusing to me.
as 4 arrays, i am everly ready wink.

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
cry 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:
cry 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.

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:


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.


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:


LOL no, the Goddess earlier asked some questions about it and being the foot slave/boy the gentleman that I try to be towards beautiful women, I tried to be courteous and answer the question(s).

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.


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:"wink;
selectedConversionUnit = stdio.nextInt();
count++;
switch(selectedConversionUnit){



case 1: System.out.println("Please enter a value in centimeter here:"wink;
centimeter = stdio.nextDouble();
System.out.println(centimeter + " " + "Equivalent in inches is:" + " " + centimeter/2.54 + "inches"wink;
break;

case 2: System.out.println("Please enter a value in meter here:"wink;
meter = stdio.nextDouble();
System.out.println(meter + " " + "Equivalent in feets is:" + " " + meter/3.28 + "feets"wink;
break;

case 3: System.out.println("Please enter a value in Celsius here:"wink;
celsius = stdio.nextDouble();
System.out.println(celsius + "C" + " " + "Equivalent in fahreinheits is:" + " " + 32+(9/5)*celsius + "fahreinheits"wink;
break;

case 4: System.out.println("Please enter a value in Naira here:"wink;
naira = stdio.nextDouble();
System.out.println( naira + "Naira" + " " + "Equivalent in Euros is:" + " " + naira/227.96 + "euros"wink;
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:"wink;
selectedConversionUnit = stdio.nextInt();
tries++;

if(selectedConversionUnit==1){
System.out.println("Enter your value in centemeter here:"wink;
centemeter = stdio.nextDouble();
cmresult = centemeter/2.54;
System.out.println(centemeter+ " " + " equivalent in inch is " + " " + cmresult + "inches "wink;
}
else if(selectedConversionUnit==2){
System.out.println("Enter your value in metres here:"wink;
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:"wink;
celsius = stdio.nextDouble();
clresult = 32+(9/5)*celsius;
System.out.println(celsius + " " + " equivalent in fahreinheits is " + " " + clresult +" " + "fahreinheits."wink;
}
else if(selectedConversionUnit==4){
System.out.println("Enter your value in Naira:"wink;
naira = stdio.nextDouble();
nrresult = naira/227.96;
System.out.println(naira + " " + "equivalent in euro is " + " " + nrresult + " " + "euros"wink;
}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"wink;
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:


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.



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.

//i couldnt use the math.random thing so i used
//what i know how to

import java.util.*;
import java.security.SecureRandom;

public class Guess
{
private static int guess,count,comGuess;

public static void main(String[] args){

SecureRandom rand = new SecureRandom();

Scanner input = new Scanner(System.in);
count = 0;
int x = 0;

while(x != -1){
System.out.println("Enter a guess between 1 and 100"wink;
guess = input.nextInt();
comGuess = rand.nextInt(100)+1;

if(guess == comGuess){

System.out.println("You win!!!\n"wink;
System.out.printf(" computer guessed %d%n%n",comGuess);
count++;

System.out.printf("It took you %d guess(es) to win.",count);

x = -1;

}else if(guess > comGuess){

System.out.println("Too high, try again!"wink;
System.out.printf(" computer guessed %d%n%n",comGuess);

count++;

}else if(guess < comGuess){

System.out.println("Too low, try again!!!"wink;
System.out.printf(" computer guessed %d%n%n",comGuess);
count++;

}

}

}
}
Re: Learning To Program With Java by the Fulaman by hardebayho(m): 5:46pm On May 09, 2016
Sugarhugs:



I tried and it didn't work. Abeg let me go with ruby, it seems easier and more detailed

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:




Which maths topics does one need to do programming? Cause I read somewhere programming requires math skills
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:

I will jus learn ruby python is too confusing for now

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:

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!!


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:

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!!

Good morning everybody smiley 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.

cheesy 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 grin 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 sad
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: "wink;
a1 = UserInput.nextFloat();
System.out.println("enter the value of b1: "wink;
b1 = UserInput.nextFloat();
System.out.println("Enter the value of c1: "wink;
c1 = UserInput.nextFloat();
System.out.println("enter the value of a2: "wink;
a2 = UserInput.nextFloat();
System.out.println("Enter the value of b2: "wink;
b2 = UserInput.nextFloat();
System.out.println("enter the value of c2: "wink;
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 = "wink; //print results
System.out.println(x);
System.out.print("y = "wink;
System.out.println(y);

}



}



}
Re: Learning To Program With Java by the Fulaman by Fulaman198(m): 7:34am On May 10, 2016
Sugarhugs:




Which maths topics does one need to do programming? Cause I read somewhere programming requires math skills

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)

Java Vs PHP: Which Has The Brightest Future? / The Top Highly Paid Programming Languages To Learn / What Are The Best Laptops For Programmers And Hackers?!

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