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
How works GPS on boats?
zaharov [31]
If you mean sonar it uses echolocation but GPS is signaled from satellite to the internal antenna
8 0
3 years ago
When you see a blank pointer this means you can drag the row or column border to change height or width
Orlov [11]
No, you would see arrows pointing in opposite directions <--> like so
7 0
4 years ago
2. A shift register can operate:
Naddik [55]
C. Both serially and Perullo
8 0
3 years ago
Write 5 chart types​
Lemur [1.5K]

Answer:

pie chart

line chart

area chart

bar charts

histogram

scatter plot

6 0
3 years ago
Which tool lists active tcp connections?
dimaraw [331]
Netstat
Type netstat -a to get a complete overview.
8 0
4 years ago
Other questions:
  • The Security Development Life Cycle (SDLC) is a general methodology for the design and implementation of an information system.
    5·1 answer
  • Chunking is a good strategy for completing large assignments because it makes the work
    10·2 answers
  • 1.where should the name of the website or company logo appear on a website
    5·2 answers
  • So, I have strict parents &amp; need help, if u don’t know how to fix this after u read it, leave. I don’t want u getting points
    11·2 answers
  • which is the quickest way to change the font color in multiple, randomly located cells in a worksheet?
    6·2 answers
  • A type of touch screen that can be up to four feet by six feet is a(n) _____.
    12·2 answers
  • Which of the following aspects of a computer is responsible for making sense of input? processing output memory storage
    14·2 answers
  • What software application is most appropriate to use to create multimedia presentations?
    6·2 answers
  • The best presentations try to include as much text as possible on each slide true or false ​
    13·1 answer
  • RAM IS often referred
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!