As a part-time student, you took two courses last term. Write a Java program that calculates and displays your grade point average (GPA) for the term. Your program should prompt the user to enter the grade and credit hours for each course. This information should then be displayed with the lowest grade first, and the GPA for the term should be calculated and displayed. A warning message should be printed if the GPA is less 2.0 and a congratulatory message if the GPA is 3.5 or above.
I have a java program which would display a message dialog box. The problem is it would stopped working before even displaying the message dialog box. This is my code.
import javax.swing.JOptionPane; public class HelloDialog { public static void main(String [] args) { JOptionPane.showMessageDialog(null, "Hello World!"); } }
There is a pop-up window which would say "Java(TM) Platform SE binary has stopped working." I am using textpad. What should I do with this?
I'm trying to make a stock program that stops the user from entering in textfield and displays a message when stock is low. There's just 2 problem the entered value by the user is only decremented twice then the total stock resets for example with SofaTotal and the if statement doesn't work:
in my ui i will i will select enabled or disabled then it will go in controller , i already debug it and it goes on the right controller based on what i select on ui my problem is when i select disabled it dont display the message but when i select enabled it displays the message, then i check the databases status is change based on what i select but when i change into disabled doesnt display any message.if select enabled will go in controller then change status into true then update the status then will see the message in ui
I need making the toString() method return a String rather than display a message to the screen. Also, I'm not supposed to call the toString method in my demo class to test it, so what should I do instead?
public class cupDispenser { String location; int noOfCups; cupDispenser(String location,int cups) { this.location=location; this.noOfCups=cups; } public String getlocation()
I wrote stand alone program to post message to IBM MQ , not sure if it posted to queue i see these Another 2,102 character(s) omitted is that mean it didnt post complete message? do i have to increase capacity of text size
I am trying to make a program that takes the information from the main args, and displays them as a email in another class when Java is run.
Ex. From: PersonA To: PersonB Email message is here
I have gotten this far, but every time I append my "email.print()" into the next class, it never can print any of the Strings.
Main Args Class:
public class TestMessage { public static void main(String[] args) { Message email = new Message("Harry Morgan", "Rudolf Reindeer"); email.append("Dear so and so,"); email.append("It is my great pleasure to"); email.append("write you an email."); email.append("");
I am trying to create a GUI with already existing code. My assignment is: Modify the Inventory Program to use a GUI. The GUI should display the information one product at a time, including the item number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory of that product. In addition, the GUI should display the value of the entire inventory, the additional attribute, and the restocking fee.
Where to start. The text book does not cover a GUI that displays this type of information rather it just displays graphics. I would like to create a separate class that holds the GUI information just to make everything flow better. I have provided my current code below:
Java Code:
// ProductTest.java // by JakeB public class ProductTest { // main method begins public static void main(String[] args) // begin main { myGUI display = new myGUI(); display.setVisible(true);
[Code] .....
This is all I have for the GUI. I am at a total loss and I am behind 2 weeks now. I cannot move forward until I am able to get this done and the class ends next week.
I am writing a program that will have a GUI window and displays an image when clicked on the image changes and clicked on again the image changes once more. Here is what i have.
I am experimenting with messages in JOptionPane and I was wondering why this program does not display anything when the choices are inputted.
*note: I tried putting "JOptionPane.showMessageDialog(null, "This is an information message", "Information", JOptionPane.INFORMATION_MESSAGE);" after the "int i = 0;" and then the messages displayed.
Scanner scan = new Scanner(System.in); int i = 0; while (i != 6) { System.out.println("1. Information message"); System.out.println("2. Error message"); System.out.println("3. Question message"); System.out.println("4. Plain message"); System.out.println("5. Warning message");
create a program that display video in second monitor ....every time i run my code it display the video in first monitor not in second monitor .. Here my path i used
Note: use for loop and printf() to format your output
public class MilesandKilometers { public static void main(String[] args) { System.out.println("Miles Kilometers"); int miles = 1 ; for (int i = 1; i <= 10; miles++, i++) { System.out.println(miles + " " + miles * 1.609); } } }
how to make it like the instruction said " use for loop and printf() to format your output".
I need to write a simple program that displays up to 5 pairings of data types (int, string) (string, long) ect. I need to have at least two classes, a Pair class (generic) and an PairTest class.
Write a program that reads an integer and displays, using asterisks, a filled diamond of the given side length. For example, if the side length is 4 the program should display.
* *** ***** ******* ***** *** *
I have it where it displays the top half of the diamond. But i cannot figure out how to get it to draw the bottom half.
import java.util.*; public class E616 { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print("Enter number of rows. "); int N=input.nextInt();
I have to write a gui program where I can enter a file name and then it gets displayed in a text area when I click Open. Conceptually, I do not get this. I was thinking of appending the text file into a string or something, but I guess I'm confused on how it all works and how I can open the text file. Not asking for the code, but just a compass or something.
Here is a simple program on applets that is giving me a bit of headache since it cannot always display the two numbers that it is supposed to: the largest and smallest of the five input integers.....I cannot see where i went wrong, you can always create separately the HTML file to load the applet in an appletviewer of your won size.
* 23.6 (Largest and Smallest) Write an applet that reads five integers, determines which are the largest and smallest integers in the group and prints them. Draw the results on the applet. */ import java.awt.Graphics; import javax.swing.JApplet; import javax.swing.JOptionPane;
You may assume that all values are positive. First figure out the maximum value. That value's bar should be drawn with 40 asterisks. Shorter bars should use proportionally fewer asterisks.
import java.util.Scanner; import java.util.ArrayList; import java.util.Arrays; public class Array717 { public static void main( String[] args )
[Code] ....
The problem is that all this code does is print 1 line of *'s and what seems to be thousands of them
I am trying to write a program that asks the user to enter a number from 1 through 10 and then the program will display the roman numeral for that number.
I am also adding a error message in which i haven't yet because im still trying to figure out how to the program will do the roman numeral.'
I have used the if and else if. but when i input a number it just repeats the number back to me.
The program cimpiles but it doesn't do what i want. here is what i have so far. how can i get the program to display the roman numeral after the number is entered.
import javax.swing.JOptionPane; public class Romannumeral { public static void main(String[] args) { double number;
I am trying to write a program that basically determines the max amount of units sold and displays it in a dialog box. Also, the program will display the winning sales associate out of 10. I have wrote the program successfully so far and I can see the maximum number of units sold displayed in the dialog box, but I cannot seem to link the winning sales person.
Here is the code I have typed so far.
//Program to find maximum of three number
import javax.swing.JOptionPane; import java.util.Scanner; public class Sales { public static void main (String[] args) { //Declare variables int num1, num2, num3, num4, num5, num6, num7, num8, num9, num10; int large; int winner;
My mad lib program was able to store my three notepad text: noun, verb, and story. I would like to find out what is the best way to make it display my result randomize my story from notepad? once everything is stored?
import java.awt.*; import java.awt.event.*; import java.io.*; import javax.swing.*; import java.util.*; public class StoryProject extends JFrame implements ActionListener
I want to write a java program which displays to get the GPA of a student as a keyboard input. Then display the class of the degree according to the following criteria using a switch-case statement (if-else statements cannot be used). If the user insert an invalid gpa you should display a message Invalid GPA.
gpa ≥ 3.50 First Class Hons 3.49 ≥ gpa ≥ 3.00 Upper Second Class Hons 2.99 ≥ gpa ≥ 2.50 Lower Second Class Hons 2.49 ≥ gpa ≥ 2.00 Pass 2.00 ≥ gpa Fail
Here is my code:
import java.io.*; public class q7 { public static void main(String[] args) { InputStreamReader ISR=new InputStreamReader(System.in); BufferedReader BR=new BufferedReader(ISR);
[code]...
.But when I use Command console to run this it says: 1111.jpg. I also wanna know is there another way to do this with switch- case statements.