1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zavuch27 [327]
3 years ago
12

Write a java program that would request user name, id number, and state the time the user has reported at work.​

Computers and Technology
1 answer:
Troyanec [42]3 years ago
3 0

Answer:

import java.text.DateFormat;

import java.text.SimpleDateFormat;

import java.time.LocalDateTime;

import java.time.format.DateTimeFormatter;

import java.util.Date;

import java.util.Scanner;  

public class Main {

   private static final DateFormat dateformat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");

   private static final DateTimeFormatter datetimeformat = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");

   public static void main(String[] args) {

       

       System.out.println("Enter your ID and Name");

       LocalDateTime current = LocalDateTime.now();

       Scanner sc1 = new Scanner(System.in);  

       String Name= sc1.nextLine();

       int ID = sc1.nextInt();

       System.out.println(Name + "reported at:");

      System.out.println(datetimeformat.format(current));

   }

}

Explanation:

The above program saves the current date-time as well, at the time when the user enters his name and ID. And it prints the same on the screen. Further, you can store these in a data structure like list or class or you can store it in a database as well. Remember, this is the difference between a program and a web application, and not to forget we have a toolkit in case of the web application. And here we are working on the console. Also, a web application has a front panel and back panel. However, a program only solves a computing problem, and there is no well-designed interface with the user. However, programming is the root of all other programmings like web programming, mobile app programming, etc.

You might be interested in
Which sentence describe internet safety precautions?
koban [17]

Which sentences describe Internet safety precautions? It is advisable to install anti-virus software on your computer. You should use strong passwords for your Internet accounts. In addition, you should avoid sharing personal information over the Internet.

#hope it helps ^_^

mark me as brainliest please

5 0
3 years ago
Jane is debugging a code consisting of 25 lines. The code starts executing at line 11. At line 13, the code calls another method
Free_Kalibri [48]
C.) 18

-------------------------------------
6 0
3 years ago
Read 2 more answers
How do you open an application on the macOS?
timama [110]

Click the Launchpad icon in the Dock, or pinch closed with your thumb and three fingers on your trackpad. Then click an app to open it. You can also type an app's name to find the app in Launchpad, then press the Return key to open it.

3 0
3 years ago
Read 2 more answers
A program with a graphical user inter-face for displaying HTML files, used to navigate the World Wide Web.
Solnce55 [7]
IP Address or World Wide Web
4 0
2 years ago
Which of the following refers to a collection of colors, fonts, and effects that can be
aev [14]

Answer:

c)style set

Explanation:

It changes the appearance of a document

4 0
3 years ago
Other questions:
  • In internet terminology, what is the term, .com, called?
    12·2 answers
  • A hub or ____ is a central point that connects several devices in a network together.
    11·1 answer
  • If a user has just added a simple triangle shape into a diagram, how can the triangle be adjusted? Check all that apply. by maki
    6·2 answers
  • Which of the following statements is true?
    8·1 answer
  • Jerry’s managing a Google Search campaign and would like to improve the position in which his ads appear. He’s increased his bid
    15·1 answer
  • A user is trying to delete a file located on an ntfs volume on his windows 8 computer but is unable to do so. Why is this.
    5·1 answer
  • Write a formula that would return a TRUE result if the sum of the first five numbers in a column of data are negative
    7·1 answer
  • What are styles? built-in conditional formatting rules formatting applied with the Format Painter defined combinations of format
    15·2 answers
  • How are most databases organized?
    15·1 answer
  • Identify and state the value of hardware components​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!