my computer glitched and all my work got deleted so i had to redo other assigned problems. will be back as soon as i catch back up
Type: Posts; User: ATB
my computer glitched and all my work got deleted so i had to redo other assigned problems. will be back as soon as i catch back up
Enter student id:1234
Enter course id: 1 for Math, 2 for English1
Students registered for Math:
null
Exception in thread "main" java.lang.NullPointerException
at...
if (courseName.equals("Math"))
i seriously dont see it . im so lost.
now it shows:
Enter student id:1234
Enter course id: 1 for Math, 2 for English2
Students registered for Math:
Exception in thread "main" java.lang.NullPointerException
at...
i am trying to insert 5 students ids and a
course number for each student id. Then it prints all
5 student ids and the course name associated with
each student id.
but im having trouble...
i have errors in the "if" and both "else if"
the compiler says "cannot convert from String to boolean and
int to String
instructions:
1. Add two private instance variables,
String...
this is my first programming course please take that into consideration please :)
instructions:
1. Add two private instance variables,
String courseName and char grade to this class.
2....
thanks! totally works!!
it gives me a ton of error messages:
Exception in thread "AWT-EventQueue-1" java.lang.Error: Unresolved compilation problems:
The constructor Circle(int, int, int, Color) is undefined
The...
this may seem like a stupid question but r they all supposed to be in one class or three different ones in one workspace?
thanks!
so im a new programmer and im bsing my way through my first online course. im not asking for answers but please take that into consideration when explaining please.
im supposed to make a bouncing...
package assignment7;
import java.awt.*;
public class Exercise5
{
public void paint(Graphics g)
{
g.drawRect(30, 50, 50, 50);
g.drawLine(30,50,40,40);
lines 7, 8, &12 "primes" are underline in red (prime cannot be resolved) is what pops up when i hover over the x's.
i don't get why that is.
package assignment7;
public class Exercise3
{...
so how do i save to the file? cause the current code already askes the user for age and prints it out?
i don't understand what you mean by that. sorry i am kind of new at this.
i am supposed to Write a program that prints a shape similar to the following shape. Maximize use of loops and minimize use of print statements.
.....*
....**
...***
..****
...***
....**...
I have attempted a new code and got a little further.
I do still have to figure out how to save to the created file.
package assignment7;
import java.io.*;
import java.util.*;
public...
1. creates a file.
2. ask user to write into that file
3. save the file
4. print content of file.
is my current exercise
so far i have gotten the code to create a file
what should i use to...
yes it does, and to print out the random number if the player loses would be the code below:
if(hasWon)
{
System.out.println("You win");
System.exit(0);
}
}...
sorry. im changing it again now i think this will be good
package assignment7;
import java.util.Scanner;
import java.util.Random;
public class Exercise1
to be honest i'm not sure what im doing but i think im missing something
here is the revised version
2759
what happens when i try to compile & run
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Duplicate local variable randomNumber
randomGenerator cannot be resolved...
hi! this is my first time one a forum and learning code, so please bear with me.
I was told to write a program which generates a random number between 0 to 5 *including 5*
and give the user 3...