0% found this document useful (0 votes)
3 views1 page

Problem A

The document outlines two problems for creating Java applications that collect user information. Problem A requires a GUI application using JOptionPane to gather first name, last name, age, and salary, then display the information formatted appropriately. Problem B involves a console application using Scanner for input, formatting the output similarly, and ensuring proper resource management with Javadoc comments included in both cases.

Uploaded by

lethaninkosi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Problem A

The document outlines two problems for creating Java applications that collect user information. Problem A requires a GUI application using JOptionPane to gather first name, last name, age, and salary, then display the information formatted appropriately. Problem B involves a console application using Scanner for input, formatting the output similarly, and ensuring proper resource management with Javadoc comments included in both cases.

Uploaded by

lethaninkosi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Problem A:

Create a Java application that prompts the user for their first name, last name, age,
and annual salary using JOptionPane input dialogs. Store each value in
appropriately typed variables. Then display all information in a single formatted
message dialog that shows full name formatted as "last name, first name", age
converted to months (calculated from years), and daily salary calculated based on
260 working days per year displayed with 2 decimal places. Include Javadoc
comments for the class and main method.

Problem B

Create a Java console application that uses the Scanner class to collect user input
from the keyboard. The program must prompt the user to enter their first name, last
name, age in years, and annual salary. Each value must be stored in an
appropriately typed variable. After collecting the input, the program must display all
the information in a clearly formatted output. The full name must be displayed in the
format “LastName, FirstName”. The program must then convert the age from years
to months and display the result. In addition, it must calculate the daily salary based
on 260 working days per year and display the result formatted to two decimal places
in South African Rand (R). The output must be neatly labelled and easy to read. The
program must use [Link]() to format the daily salary correctly. Proper
Javadoc comments must be included for both the class and the main method. The
Scanner object must be closed at the end of the program.

You might also like