that was my full code and another is a string variable too hold one of my inputs at the end of my program.
Type: Posts; User: morrism35
that was my full code and another is a string variable too hold one of my inputs at the end of my program.
I did that and got another compiler error message of can't find the symbol at the while
statement "while (another.equalsIgnoreCase("y"))". Never heard of a semicolon on a while statement.
import java.util.Scanner;
import java.util.Random;
//Michael Morris CSC151
public class PP4_8
{
public static void main (String [] args)
{
Random generator=new Random();
import java.util.Scanner;
import java.util.Random;
//Michael Morris CSC151
public class PP4_8
{
public static void main (String [] args)
{
Random generator=new Random();
}while(guess1!=gen1) ';' expected- this is the error message
If I add a semicolon ; at that while(guess1!=gen1) then I get another compiler error message of can't find the symbol at this while...
My program keeps throwing this compiler error and my program is due by 12. Cannot figure this out. Please help.
import java.util.Scanner;
import java.util.Random;
//Michael Morris CSC151
...
Im just entering my second beginning java class as a seconr semester student. Im a java major however i want to do more cool web stuff with programming. I guess i want my programming to be more with...
Dont expect a magic solution nor a quick fix. I expect to work hard towards those goals i was just asing what other ways to get better. I understand just getting in there and doing it.
I want to be good at programming. Not just java but other languages. The concepts of java arent hard to learn however my problem has always been where to start probpem solving especially when the...
I just took beginning java oop and what I don't understand is why use a no-arg constructor to initialize a variable instead why not use a setter method(setLength of field private variable). I can...
I want nursing home 1 total rooms or total occupied rooms separate from nursing home 2. instead of saying 80 total rooms it should say 60. it should say 20 for the first nursing home.
This is...
public class project3DemoMorris
{
public static void main(String[] args)
{
int buildNum; //number of buildings
int floorNum; //number of floors
int roomFloor; //number of rooms...
Is there any way in Java to reset my accumulator to zero after I get all of my user data in my first go around in my loop and have it displayed. Here is a short posting of my code. After my first...
Thank you that was the problem I figured it out when I started removing code before I read this.
/**
Creating project3Morris class
*/
//Fields
public class Project3Morris
{
So your saying number of occupied rooms / number rooms shoupdnt give you .75.
20/15 is .75 im Not Concerned With Having It Print As A Percentage.
My Instructions Were To Print Average...
It Should Be 75 or .75 as A Decimal. This Shouldnt Be Complicated. I Can Use Decimalformat To have It Show As A Percent If It At Least Computed As The Correct Decimal.
--- Update ---
My if else...
Im Plugging In 20 for numRooms Divided By 15 numroomsoccupied And Getting 1.0 futhermore None Of My If Else Staements Are being Executed. Getting Very frustrated Havent Failed An Assignment Yet.
import java.text.DecimalFormat; //Needed to format occupancy rate as percentage
import java.util.Scanner; //Needed for the scanner class
// This program was created by Michael Morris
/** This...
import java.text.DecimalFormat; //Needed to format occupancy rate as percentage
import java.util.Scanner; //Needed for the scanner class
// This program was created by Michael...
not sure how to do that. Im a beginner
--- Update ---
using jgrasp
--- Update ---
my occupancy rate doesn't compute right also all my if else if statements aren't being executed to get my...
import java.text.DecimalFormat; //Needed to format occupancy rate as percentage
import java.util.Scanner; //Needed for the scanner class
// This program was created by Michael Morris
/** This...
Having major problems getting this program due tonight. Never had a problem with the basic programs as a beginner but this is too much. It's due tonight and no I didn't procrastinate I'm just not...