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 of the following statements is false? Question 4 options: By convention class names begin with an uppercase letter, and me
amm1812

Answer:

Instance variables can be declared anywhere inside a class.

Although there isn't any rule to declare instance variables before methods, and they can be declared anywhere in the class, they cannot be declared inside method definitions of class.

///////////////////////////////////////////////////////////////////////////////////////////////////////////

<em>By convention class names begin with an uppercase letter, and method and variable names begin with a lowercase letter.</em> - True.

<em>Instance variables exist before methods are called on an object, while the methods are executing and after the methods complete execution.</em> - True.

<em>A class normally contains one or more methods that manipulate the instance variables that belong to particular objects of the class.</em> - True

8 0
3 years ago
Read 2 more answers
The Sarbanes-Oxley Act restricts electronic and paper data containing personally identifiable financial information.A. True
Zarrin [17]

Answer:

B. False

Explanation:

Sarbanes-Oxley Act or SOX also known as the Public Company Accounting Reform and Investor Protection Act and Corporate and Auditing Accountability, Responsibility, and Transparency Act is a United State federal law that creates or modify requirements for U.S public company board, management and public accounting firm. some of its policies are meant for private companies as well.

This act does not restrict any electronic and paper data containing personally identifiable financial information.

6 0
3 years ago
Data stored in computer systems has a high value because there is a great deal of time and effort that goes into creating an ana
Andrew [12]

Answer:

Data often has intrinsic value.

Explanation:

Data stored in computer systems has a high value because there is a great deal of time and effort that goes into creating an analyzing it and data often has intrinsic value.

5 0
3 years ago
Write an If/else statement to check whether host is online. If it is online, then print system is online otherwise print system
Reika [66]

Answer:

from socket import *

hostname = input('Enter the host to be scanned: ')

ip_add = gethostbyname(hostname)

connections = [ ]    

for i in range(133, 136):

   s = socket(AF_INET, SOCK_STREAM)

     

   conn = s.connect_ex((ip_add, i))

   print(conn)

   connections.append(conn)

if 0 in connections:

   print ('Host is online')

   s.close()

else:

   print ('system is unreachable')

Explanation:

The python source code above scans for all the available range of ports in the provided hostname, if any port is available, the host is online else the program print the error message "system is unreachable.

4 0
3 years ago
when a driver receives a text while driving, what can 2022 versa’s hands-free text messaging assistant do?
Lena [83]

Answer:

It can translate text to voice

Explanation:

7 0
2 years ago
Other questions:
  • The sun produces energy by the process of nuclear: <br><br> A.fission <br> B.fusion
    7·2 answers
  • How many answer or point do I answer/need to sent message?
    6·1 answer
  • Crop marks are used on an illustration to indicate to the printer the
    10·1 answer
  • Harmful programs used to disrupt computer operation, gather sensitive information, or gain unauthorized access to computer syste
    10·1 answer
  • Your ___ can provide hardware firewall protection for your home network where it connects to the ISP's network, just as ISP netw
    12·1 answer
  • Find the equation of a line which has 10 points the following two coordinates: (4, 0) and (3, 4)​
    13·1 answer
  • Gun to yo head any last words??
    10·2 answers
  • Which specialized information system is used by passport agencies and border inspection agencies to check the names
    13·1 answer
  • Davingould1115...................answer 2​
    11·2 answers
  • What kind of goal does ariel set when he works to graduate from high school in four years? short term long term normative fantas
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!