Marving Guildon

Greenhorn
+ Follow
since Sep 17, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Marving Guildon

Thanks, it works.
18 years ago
I have the following switch statement and I need to end the program if the user select number 2.

When the user select the number 2, the program still runing, but it needs to terminate.
18 years ago
Joe,
I�m doing my work, I just don�t know and I have to ask, it is part of the learning process. I�m sorry if I insulted your in a previous posting. Let�s get something done and don�t sweat the small stuff.
18 years ago
This is what I have so far:

Here is the main method:

And here is the error message for PartyXXX:

Can you help to solve this error?
18 years ago
Joe,
That's an excellent idea, I will ask the instructor, thanks. You are really smart.
18 years ago
Joe,
Thanks for taking the time and review my program. I tried each code individually and they work, but when I put it together I got the error messages. So, I already used the programming technique that you referred. Any way, if you don't know how to fix it, probably somebody with experience in programming will help.
[ October 06, 2003: Message edited by: Marving Guildon ]
18 years ago
This is what I have so far to completed the following assigment:
The program should include a menu of options using a switch statement, a for statement, three or more methods, an array, a loop, an if statement and instance variable and methods.
Design the program to call methods kept in the PartyXXX file form the main method. One method could tell something about the party such as where it's located, what time it will be and what the party goers need to bring. Another could calculate the cost for supplies, food, drinks, etc.
I got the following errors:

Here is my PartyXXX code:


The main program is here:

[ October 06, 2003: Message edited by: Marving Guildon ]
18 years ago
Hello friends,
I got the task to create a program to assist in hosting of a halloween party. The program must call methods kept in the PartyXXX file from the main method PartyXXXStart. One method must serve to display the party location, time and what to bring, another method could calculate the cost for the party and who will be invited, and other method could be a list of the most popular customs. The program must included a switch statement, a for statement, three or more methods, an array, a loop, an if statement and instance variables and methods.
If you have already created a similar program that could be adjusted or if you have any idea that you want to share, please let me know.
Here is what I have so far, first the error messages:




Here is the main program:

At least I leaned how to post the question.
[ October 06, 2003: Message edited by: Marving Guildon ]
18 years ago
The instruction for the homework are as follow:
The instruction for the homework are as follow:
"Write a program using an array that prints out the counting numbers form 1 through 60 that can be divided evenly by 4. The program should print out the numbers from left to right on your DOS screen wiht no more thatn 4 numbers on a line and at least three spaces between numbers. Also print out the number of numbers and the sum of all these numbers that can be evenly divided by 3."
The following is the code that I have so far:
/

public class ArrayTableXXX
{
public static void output()
{
/* Declare the variables used in the program. */
int x, y, num, sum, junk;
/* Initialize the variable num to one. */
num = 0;
/* This statement declares a multi-dimentional
array with 15 elements named anArray. */
int[][] anArray = new int[4][4];
/* Tells the user what the program will perform. */
System.out.println("This program outputs the counting ");
System.out.println("numbers divisible by 4 starting at 60 in ");
System.out.println("descending order using a multi-dimentional array.");
System.out.println("The output will be shown is two variations.");
System.out.println(" ");
/*This for loop assigns values the array named anArray using
four rows with four numbers in each row. */
for(x=0; x<4; x++)
{
for(y=0; y<4; y++)
{
anArray[x][y]=num * 4;
num++;
}
}
/*The following code uses two for loops
to print out the array named anarray using
four rows with four numbers in each row. */
for(x=0; x<4; x++)
{
for(y=0; y<4; y++)
{
anArray[x][y]=(num -1) * 4;
num--;
}
}

/*The following code uses two for loops
to print out the array named anarray using
four columns with four numbers in each row. */
for(x=0; x<4; x++)
{
for(y=0; y<4; y++)
{
/* This if statement is used to add two
extra space in the output of the array
value if the value.*/
if(anArray[x][y] < 100)
{
System.out.print(" " + anArray[x][y]);
System.out.print(" ");
}
else
{
System.out.print(anArray[x][y]);
System.out.print(" ");
/* This if statement prints a blank
line after all the elements in the
array have been printed. */
if (y == anArray.length)
{
System.out.println(" ");
}
}/*end of else -if statement*/
}/*end of for loop*/
System.out.println(" ");
}
System.out.println(" \n\n");
num = 1;
sum = 0;
count = 0;
/* This statement declares a multi-dimentional
array with 15 elements named anArray. */
int[][] twoArray = new int[5][4];
for(x=0; x<5; x++)
{
for(y=0; y<4; y++)
{
twoArray[x][y]=num * 3;
num++;
}
}

/*The following code uses two for loops
to print out the array named anarray using
four columns with four numbers in each row. */
for(x=0; x<5; x++)
{
for(y=0; y<4; y++)
{
/* This if statement is used to add two
extra space in the output of the array
value if the value.*/
if(twoArray[x][y] < 100)
{
System.out.print(" " + twoArray[x][y]);
System.out.print(" ");
}
else
{
System.out.print(twoArray[x][y]);
System.out.print(" ");
/* This if statement prints a blank
line after all the elements in the
array have been printed. */
if (y == twoArray.length)
{
System.out.println(" ");
}

sum = sum + twoArray[x][y];

/*count the numbers*/
count = count 1;

}/*end of else -if statement*/
}/*end of for loop*/
System.out.println(" ");
}
System.out.println(" ");

} /* end of output method */
public static void main(String[] args)
{
ArrayTableXXX.output();
}
}/*end of ArrayTableXXX.*/

Thanks for your help.
[ September 28, 2003: Message edited by: Marving Guildon ]
[ September 28, 2003: Message edited by: Marving Guildon ]
18 years ago