The lab I got from my teacher is supposed to be a 2D array. We're supposed to be using it to where it reads the strings from the file, and then it prints them out in an hour glass form like this:
...
Type: Posts; User: xionyus
The lab I got from my teacher is supposed to be a 2D array. We're supposed to be using it to where it reads the strings from the file, and then it prints them out in an hour glass form like this:
...
First off, he wanted the area code to be only these, but random each time: 218, 312, 731.
The next three numbers needed like a range from 231 to 750. So I set up a variable
Then the last four...
I get the fact that it's an easy concept. The lab my teacher wanted us to construct is a random phone number generator.
The area code has to be 218, 312, or 731, it can't be anything else. He told...
import java.util.Scanner;
public class BirthdayEdit {
public static void main (String arg[])
{
Scanner sc = new Scanner(System.in);
boolean cont = true;
while(cont) {
int...
I got it working now, but what do I type after Continue pops up?
I'm inputting cont, yes, true, and each just ends the process.
Well, it gives this:
Am I placing the while in the beginning of the program?
If I do it like that, it's giving me multiple errors.
Thing is, teacher just wanted me to input three numbers like so:
10 20 1990
And when you hit enter it tells you the day you were born.
Would this still be possible to do in a while statement?
It's not really over my head, I've been coding and stuff since I was about nine, I learned HTML and CSS from neopets. x3
And I code permissions for MineCraft.
It's just the fact that the first...
It made my code much more cleaner! Thanks. :D
One thing can be break the program though.
If I enter a month number over 12, or a negative, then it will still input a day. I know I could fix it...
Gaah! Thank you so much, it helped me lots. :]
If you're still there I'm wondering if there will be a way to make an error code so that if my teacher types in Feburary 30th, it would give him an...
import java.util.Scanner;
public class BirthdayEdit {
public static void main (String arg[])
{
Scanner sc = new Scanner(System.in);
int birthMonth = sc.nextInt();
int birthDay...
I've been outta school for two weeks and I've been working on this program from my Com Sci class for about three hours. It's supposed to be something that will tell you what day you were born on. For...