samyomz: jdk is java development kit right And it's used to develop apps right??... I don't have jdk but i have android studio.. My question is... Can i use android studio to learn here or should i go and get jdk?? Tnx
write a multiplication time table program that accept user input, the inputed value will be for the time table. Time table should be from 1 to 12. Use for loop.
example 5 times 1 is 5 5 times 2 is 10 5 times 3 is 15
just like that.
import java.util.*;
public class Main { public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Please enter a number:" int x = input.nextInt();
for(int a = 1; a <= 12; a++){
System.out.println(x + " x " + a + " = " + x * a); }
Collinz2: nobody can teach complete java except the basics, i beleive thoes advanced developers learn the basics and start programming for the rest of their life which made them know java like abc.
I never said anyone could teach you complete Java. All I said was for u to take your time.
To learn COMPLETE Java, you'll have to use up to a year or more with full dedication and seriousness. Although, if you're alerady a developer, then it'll take you less
HateU2: Not only broken self but crashed to pieces. All the 'Gbosas' in d world 4 d girl dat broke his heart. May God bless her 4 me. She did a very good work.
Collinz2: Thats great. I kinda understand it but when i compile the code i got exception error so i skip it and when i get to exception i will return to it.
One more thing, just like what pachman is asking. For instance using the indexOf to check for @ in an email, i wrote the code and add user input scanner and the if statement. If the user enter an email without the @ it wil return invalid email as i instructed java to do, so How do i tell java to tell the user to keep inputing the email until he got it correct.
Collinz2: am not following the lessons here though, but multi-dimensional array is giving me headache.
Yeah bro, I feel your pain. I remember when I was also learning arrays and arraylists. Na that multidimensional array wan kill me...
But remember, when you're creating a multidimensional array, you're basically saying:
Create -rows and -columns. Like this:
int[][] x = new int[4] [3];
This statement will create an array of 4 rows and 3 columns.
So if you want to like assign a value to the first row and third column, you say x[0] [3] = 25; This will assign the value 25 to the first row and third column.
If you're also confused about rows and columns, check this out:
I checked for the meaning of row in my dictionary and dis is what I got:
A line of entries in a table, etc., going from left to right, as opposed to a column going from top to bottom
So if I have some numbers like this,
0 1 2 3 4 5 6 7 8 9
What row and column is 7? Basically, we have just one row in this block. So to represent this in Java, we write num[0][8] which is equivalent to 7.
Fulaman198: Guys one of my friends used Java as a means to parse some live data from the world bank site about forestation around the world. The data was parsed from a CSV file and put out in the form of an applet using the UnfoldingMaps API/library to illustrate the data in the csv file. I just wanted to show this to you to keep you motivated about some of the things you can do in Java.
olarid01: Well done bro. But this won't take care of the two years and also it can be generalized so that the number of courses in each year will be requested at program start.
Take a look a this:
#include <stdafx.h> #include <iostream> using namespace std;
int main() { char pause; //Number of courses per year int yone, ytwo;
const int NoOfStudents = 2; cout << "\nHow Many Courses in Year One? " << "\t"; cin >> yone ; cout << "\nHow Many Courses in Year Two? " << "\t"; cin >> ytwo ;
//Creating the student data structure struct Genstudent{ float *Yearone; float *Yeartwo; };
//Creating Array of students for the number of students Genstudent student[NoOfStudents];
//Initializing the students variables for(int x = 0; x < NoOfStudents; x++){ student[x].Yearone = new float[yone]; student[x].Yeartwo = new float[ytwo]; }
//Getting All the Scores for(int x = 0; x < NoOfStudents; x++){ //getting the scores For Year One for all students cout<<"Student "<<x+1<<"\n"; cout<<"========="<<"\n"; for (int i=0; i<yone; i++){ cout<<"\n\tStudent"<<x+1<<": Input Score For Year 1 Course: "<<i+1<< "\t"; cin>>student[x].Yearone[i]; } //getting the scores For Year two for all students for (int i=0; i<ytwo; i++){ cout<<"\n\tStudent"<<x+1<<": Input Score For Year 2 Course: "<<i+1<< "\t"; cin>>student[x].Yeartwo[i]; }
}
//Printing All the Scores
// For Year ONE cout << "\n\n\t\t The Scores For Year One Are\n"; cout << "\t\t === ====== === ==== === ===\n";
cout<<"\t\t"; for (int i=0; i<yone; i++){ cout<<"Course "<<i+1<<"\t"; } //putting a line break cout<<"\n";
for(int x = 0; x < NoOfStudents; x++){ //getting the scores For Year One for all students cout<<"Student"<<x+1<<": "<<" \t"; for (int i=0; i<yone; i++){ cout<<student[x].Yearone[i]<<"\t\t"; } cout<<"\n"; }
// For Year TWO cout << "\n\n\t\t The Scores For Year Two Are\n"; cout << "\t\t === ====== === ==== === ===\n";
cout<<"\t\t"; for (int i=0; i<ytwo; i++){ cout<<"Course "<<i+1<<"\t"; } //putting a line break cout<<"\n";
for(int x = 0; x < NoOfStudents; x++){ //getting the scores For Year One for all students cout<<"Student"<<x+1<<": "<<" \t"; for (int i=0; i<ytwo; i++){ cout<<student[x].Yeartwo[i]<<"\t\t"; } cout<<"\n"; } //Deallocating All the used Array for(int x = 0; x < NoOfStudents; x++){ delete [] student[x].Yearone; delete [] student[x].Yeartwo; } cin>>pause; return 0; }
For one bruh, I don't know c++. Two, the information she provided is not really clear to me.
I was browsing through YouTube and I saw this hilarious mark angel comedy video and I thought to share with you guys. Some of you have probably watched it already, buh I'll post the video link.
For those who don't have data to watch the video, what the video contains is this:
Your girlfriend came to you to tell you that a guy slapped her. For one reason or the other, you followed her to the guy's place to fight. On getting there, you discovered that the guy that slapped your girlfriend is an army man.
My question here goes to the guys. If it was you, what would you do?.
njiasi30: My dear, ur President or let me say dangote as one of d richest man..... Does he use a phone of 4.9m or is it dat he can't afford it I always learn to spend wisely OK
Do u know the kind of phone dangote is using or how much he bought it? As for me, as long as I'm still sane, I can buy whatever I like. The cost doesn't always matter. All that matters is that I got what I want and it makes me happy