COSC 600
Programming Assignment
1
Due D
ate
:
September
1
3
(
Tuesday
) by
7
pm
NOTE: Please submit a soft copy
to the blackboard
c
ontaining your source codes
and
hand in the
hard copies of source codes with your outputs together
in class
. We
will run your p
rogram for grading your program assignments.
Problem 1
.
Introduce Yourself
W
rite a
Java
program
that
interactively request
s
the following information:
•
Your
first name
•
Your
last name
•
Your
date of birth
•
Your
email address
Output/Input:
First name:
John
Las
t name:
Doe
Birth year:
1995
Birth month:
9
Birth day
:
7
Email address
:
jdoe1students.t.edu
After obtaining the above information the program should display the following
summary:
Output:
John Doe is 20 years old and
the email address is jdoe1studen
ts.t.edu
.
String lastname,
firstname, email, month, day, year, dateofbirth;
Scanner profile = new
Scanner (System.in);
System.out.print ("Enter
Last Name: ");
lastname =
profile.nextLine();
lastname
=lastname.toUpperCase();
System.out.print ("Enter
First Name: ");
firstname =
profile.nextLine();
firstname
=firstname.toUpperCase();
System.out.println("Enter date of birth");
System.out.print("Month: "+ " ");
month =
profile.nextLine();
System.out.print("Day:
"+ " ");
day =
profile.nextLine();
System.out.print("Year:
"+ " ");
year =
profile.nextLine();
System.out.print ("Enter
Email: ");
email =
profile.nextLine();
System.out.println
("Last Name: "+lastname);
System.out.println
("First Name: "+firstname);
System.out.println
("Birth year: "+year);
System.out.println
("Birth month: "+month);
System.out.println
("Birth day: "+day);
System.out.println
("Email: "+email);
System.out.println
(firstname+ " " +lastname + " is "+ "years old and the email
address is " +email+".");
}
}
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
COSC 600 Programming Assignment 1 Due D ate : September 1 3 ( Tuesday ) by...
Java debugging in eclipse package edu.ilstu; import java.util.Scanner; /** * The following class has four independent debugging * problems. Solve one at a time, uncommenting the next * one only after the previous problem is working correctly. */ public class FindTheErrors { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); /* * Problem 1 Debugging * * This problem is to read in your first name, * last name, and current year and display them in *...
read the code and comments, and fix the program by INSERTING the missing code in Java THank you please import java.util.Scanner; public class ExtractNames { // Extract (and print to standard output) the first and last names in "Last, First" (read from standard input). public static void main(String[] args) { // Set up a Scanner object for reading input from the user (keyboard). Scanner scan = new Scanner (System.in); // Read a full name from the user as "Last, First"....
Zeller's congruence is an algorithm developed to calculate the day of the week. Write a program that prompts the user to enter a year, month, day of month and it displays the name of the week. Here is my source code. I need it broke down into a flowchart. public static void main(String[] args) { //all variables are initialized to 0, because local variables require at least an initial value before use Scanner input = new...
Please help. I need a very simple code. For a CS 1 class. Write a program in Java and run it in BlueJ according to the following specifications: The program reads a text file with student records (first name, last name and grade). Then it prompts the user to enter a command, executes the command and loops. The commands are the following: "printall" - prints all student records (first name, last name, grade). "firstname name" - prints all students with...
Please complete the following programming with clear explanations. Thanks! Homework 1 – Programming with Java: What This Assignment Is About? Classes (methods and attributes) • Objects Arrays of Primitive Values Arrays of Objects Recursion for and if Statements Selection Sort Use the following Guidelines: Give identifiers semantic meaning and make them easy to read (examples numStudents, grossPay, etc.) Use upper case for constants. • Use title case (first letter is upper case) for classes. Use lower case with uppercase...
Assignment 14.3: Valid Email (10 pts) image source Write a program that takes as input an email address, and reports to the user whether or not the email address is valid. For the purposes of this assignment, we will consider a valid email address to be one that contains an @ symbol The program must allow the user to input as many email addresses as desired until the user enters "q" to quit. For each email entered, the program should...
My Java code from last assignment: Previous Java code: public static void main(String args[]) { // While loop set-up boolean flag = true; while (flag) { Scanner sc = new Scanner(System.in); // Ask user to enter employee number System.out.print("Enter employee number: "); int employee_number = sc.nextInt(); // Ask user to enter last name System.out.print("Enter employee last name: "); String last_name = sc.next(); // Ask user to enter number of hours worked System.out.print("Enter number of hours worked: "); int hours_worked =...
My Java code from last assignment: Previous Java code: public static void main(String args[]) { // While loop set-up boolean flag = true; while (flag) { Scanner sc = new Scanner(System.in); // Ask user to enter employee number System.out.print("Enter employee number: "); int employee_number = sc.nextInt(); // Ask user to enter last name System.out.print("Enter employee last name: "); String last_name = sc.next(); // Ask user to enter number of hours worked System.out.print("Enter number of hours worked: "); int hours_worked =...
By editing the code below to include composition, enums, toString; must do the following: Prompt the user to enter their birth date and hire date (see Fig. 8.7, 8.8 and 8.9 examples) in addition to the previous user input Create a new class that validates the dates that are input (can copy date class from the book) Incorporate composition into your class with these dates Use enums to identify the employee status as fulltime (40 or more hours worked for...
C++ edit: You start with the code given and then modify it so that it does what the following asks for. Create an EmployeeException class whose constructor receives a String that consists of an employee’s ID and pay rate. Modify the Employee class so that it has two more fields, idNum and hourlyWage. The Employee constructor requires values for both fields. Upon construction, throw an EmployeeException if the hourlyWage is less than $6.00 or over $50.00. Write a program that...