Write a Java program which displays a menu to allow user the following functionality: 1. Load employees’ data - prompts user for the number of employees to be loaded and then prompts for each employee name, id (5 digit number), and annual salary

Answers

Answer 1

Answer:

Explanation:

The code I created is written in Java. It creates an Employee class that holds the employee's name, id, and salary. Then the main method has a menu that asks the user if they want to load data, print data, or exit. Each of which is fully functioning. If the user wants to load data, it asks them how many employees they want to add and then allow them to add the employees by calling the Employee class every time and saving the objects in an ArrayList. The program has been tested and the output can be seen in the image below.

import java.util.ArrayList;

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

      Scanner in = new Scanner(System.in);

      ArrayList<EmployeeData> companyData = new ArrayList<>();

      boolean loopAgain = true;

      while (loopAgain) {

          System.out.println("Menu:");

          System.out.println("1: Load Employee Data");

          System.out.println("2: Print Employee Data");

          System.out.println("3: Exit");

          int answer = in.nextInt();

          switch (answer) {

              case 1: {

                  System.out.println("How many employees will you add?");

                  int loop = in.nextInt();

                  for (int i =0; i < loop; i++) {

                      companyData.add(new EmployeeData());

                  }

              } break;

              case 2: {

                  for (EmployeeData x : companyData) {

                      x.printData();

                  }

              } break;

              case 3: loopAgain = false; break;

          }

      }

   }

}

class EmployeeData {

   String name;

   int id, salary;

   public EmployeeData() {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter Employee Name: ");

       String name = in.nextLine();

       System.out.println("Enter Employee ID:");

       int id = in.nextInt();

       System.out.println("Enter Employee Salary: ");

       int salary = in.nextInt();

       this.name = name;

       this.id = id;

       this.salary = salary;

   }

   public void printData() {

       System.out.println("Employee: " + this.name);

       System.out.println("ID: " + this.id);

       System.out.println("Salary: " + this.salary);

   }

}


Related Questions

Discuss the OSI Layer protocols application in Mobile Computing

Answers

Answer:

The OSI Model (Open Systems Interconnection Model) is a conceptual framework used to describe the functions of a networking system. The OSI model characterizes computing functions into a universal set of rules and requirements in order to support interoperability between different products and software.

Discuss the DMA process​

Answers

Answer:

Direct memory access (DMA) is a process that allows an input/output (I/O) device to send or receive data directly to or from the main memory, bypassing the CPU to speed up memory operations and this process is managed by a chip known as a DMA controller (DMAC).

Explanation:

A defined portion of memory is used to send data directly from a peripheral to the motherboard without involving the microprocessor, so that the process does not interfere with overall computer operation.

In older computers, four DMA channels were numbered 0, 1, 2 and 3. When the 16-bit industry standard architecture (ISA) expansion bus was introduced, channels 5, 6 and 7 were added.

ISA was a computer bus standard for IBM-compatible computers, allowing a device to initiate transactions (bus mastering) at a quicker speed. The ISA DMA controller has 8 DMA channels, each one of which associated with a 16-bit address and count registers.

ISA has since been replaced by accelerated graphics port (AGP) and peripheral component interconnect (PCI) expansion cards, which are much faster. Each DMA transfers approximately 2 MB of data per second.

A computer's system resource tools are used for communication between hardware and software. The four types of system resources are:

   I/O addresses    Memory addresses.    Interrupt request numbers (IRQ).    Direct memory access (DMA) channels.

DMA channels are used to communicate data between the peripheral device and the system memory. All four system resources rely on certain lines on a bus. Some lines on the bus are used for IRQs, some for addresses (the I/O addresses and the memory address) and some for DMA channels.

A DMA channel enables a device to transfer data without exposing the CPU to a work overload. Without the DMA channels, the CPU copies every piece of data using a peripheral bus from the I/O device. Using a peripheral bus occupies the CPU during the read/write process and does not allow other work to be performed until the operation is completed.

With DMA, the CPU can process other tasks while data transfer is being performed. The transfer of data is first initiated by the CPU. The data block can be transferred to and from memory by the DMAC in three ways.

In burst mode, the system bus is released only after the data transfer is completed. In cycle stealing mode, during the transfer of data between the DMA channel and I/O device, the system bus is relinquished for a few clock cycles so that the CPU can perform other tasks. When the data transfer is complete, the CPU receives an interrupt request from the DMA controller. In transparent mode, the DMAC can take charge of the system bus only when it is not required by the processor.

However, using a DMA controller might cause cache coherency problems. The data stored in RAM accessed by the DMA controller may not be updated with the correct cache data if the CPU is using external memory.

Solutions include flushing cache lines before starting outgoing DMA transfers, or performing a cache invalidation on incoming DMA transfers when external writes are signaled to the cache controller.

Answer:

See explanation

Explanation:

DMA [tex]\to[/tex] Direct Memory Access.

The peripherals of a computer system are always in need to communicate with the main memory; it is the duty of the DMA to allow these peripherals to transfer data to and from the memory.

The first step is that the processor starts the DMA controller, then the peripheral is prepared to send or receive the data; lastly, the DMA sends signal when the peripheral is ready to carry out its operation.

Write a program that takes a date as input and outputs the date's season. The input is an integer to represent the month and an integer to represent the day. Ex: If the input is: 4 11 the output is: spring In addition, check if both integers are valid (an actual month and day). Ex: If the input is: 14 65 the output is: invalid The dates for each season are: spring: March 20 - June 20 summer: June 21 - September 21 autumn: September 22 - December 20 winter: December 21 - March 19

Answers

Answer:

Explanation:

The following program is written in Java. It is a function that takes in the two parameters, combines them as a String, turns the combined String back into an integer, and uses a series of IF statements to check the parameters and determine which season it belongs to. Then it prints the season to the screen. The code has been tested with the example provided in the question and the output can be seen in the attached image below.

class Brainly {

   public static void main(String[] args) {

       getSeason(4, 65);

       getSeason(4, 11);

   }

   public static void getSeason(int month, int day) {

       String combined = String.valueOf(month) + String.valueOf(day);

       int combinedInt = Integer.parseInt(combined);

       if ((month > 0 && month < 12) && (day > 0 && day < 31)) {

           if ((combinedInt >= 320) && (combinedInt <= 620)) {

               System.out.println("The Season is Spring");

           } else if ((combinedInt >= 621) && (combinedInt <= 921)) {

               System.out.println("The Season is Summer");

           } else if ((combinedInt >= 922) && (combinedInt <= 1220)) {

               System.out.println("The season is Autumn");

           } else {

               System.out.println("The Season is Winter");

           }

       } else {

           System.out.println("Invalid date");

       }

   }

}

5 Major of computer application

Answers

Im assuming you means applications as in Apps.

Microsoft windows
Microsoft internet Explorer
Microsoft office or outlook
Mcafee antivirus
Adobe pdf

Answer:

Basic Applications of Computer

1 ) Home. Computers are used at homes for several purposes like online bill payment, watching movies or shows at home, home tutoring, social media access, playing games, internet access, etc.

2 ) Medical Field.

3 ) Entertainment.

4 ) Industry.

5 ) Education.

Explanation:

Hope it helps you

Mark my answer as brainlist

have a good day

Instructions
Create a multimedia project that contains the text element and all the contents that you have studied about that element

Answers

Answer:

iiiio888887776558777u765

g Add a throw statement to the processNumbers function that throws the message "An element in the list is not a number." if one of the elements in toProcess is not a number. Hint: The function isNaN() returns true if the parameter is not a number.

Answers

Answer and Explanation:

function processNumbers(alist){

var Ourarray= new array(alist);

Ourarray.foreach(

if(isNaN()){

Console.log( "An element in the list is not a number."};

break;

}

}

processNumbers(alist)

From the above, we have defined a function that takes an array parameter(the following array variable will make sure of that). We test each element in the array using foreach array function. The for each function runs the if statement and if isNan is true for each of the elements in the array.

Alexis received an email message from an unknown sender that included an attachment.

If she opens the attachment, what kind of malicious software might be activated, and what are the consequences?


Opening the attachment would release a worm, which would infect her system with a virus.


Opening the attachment would release a worm, which would infect her system with spyware.


Opening the attachment would release an active worm, which would infect her system with adware.


Opening the attachment would release a passive worm, which would infect her system with adware.

Answers

Answer:

Opening the attachment would release a worm, which would infect her system with a virus.

Answer:  B. Opening the attachment would release a worm, which would infect her system with a virus.

3. Coaxial/telephone cable sends
during the data transmission
signal

Answers

Answer:

high frequency signal.

T
N
O
?
You can insert only the row
only to
True or false

Answers

false

Explanation:

good luck bro

have a great day

Answer:

false

Explanation:

e) Point out the errors( if any) and correct them:-
class simple
{
inta,b,c;
double sumNumber
{
int d = a + b + c;
double e = d/5.6;
return e;
}
void show Number()
{
a = 10, b = 20, c=5;
System.out.println(d);
double f = sumNumber(a,b,c);
System.out.print(e);
}
}​

Answers

Explanation:

double e-d/5.6;is wrong it should return to c

What do you do if your computer dies/malfunctions? Reboot (Restart) Shut Down Recovery CD and Recover your system Call a person to fix it​

Answers

Answer:

Restart

Explanation:

Simply I may restart my pc if it dies/malfunctions. I'll not restart immediately, I'll wait for an hour and do restart my computer. If it doesn't work then maybe I'll Call a person to fix it.

Select the scenario that describes a top-down approach to data warehouse design.


Cathy’s Cards and Gifts, which has three stores, creates data marts for its sales, marketing, and delivery departments to study the possibility of establishing a new store.


Crawford's Fabrics, which wants to expand its operations, combines data from the purchasing and sales departments into a central database, to be divided into new data marts as needed.


Cynthia’s Florals, which is dealing with debt, creates new data marts for the service, delivery, and sales departments to develop a strategy to stay in business.


Connor’s Meat Market, which just opened, creates data marts to track the sale of each of the following meats: beef, pork, lamb, and fish.

Answers

Answer:

Crawford's Fabrics, which wants to expand its operations, combines data from the purchasing and sales departments into a central database, to be divided into new data marts as needed.

The scenario defines a top-down approach to data warehouse design as "Crawford's Fabrics, which wants to expand its operations, combines data from the purchasing and sales departments into a central database, to be divided into new data marts as needed".

What is a top-down approach to data warehouse design?

In the "Top-Down" method system, a data warehouse exists defined as a subject-oriented, time-variant, non-volatile, and integrated data storage for the entire business data from various sources exist validated, reformatted, and saved in a normalized (up to 3NF) database as the data warehouse.

Therefore, the correct answer is option b) Crawford's Fabrics, which wants to expand its operations, combines data from the purchasing and sales departments into a central database, to be divided into new data marts as needed.

To learn more about warehouse design

https://brainly.com/question/25885061

#SPJ2

Write a program named lastname_firstname_cities.py that works with information about large cities. Your program will open the cities.txt downloadfile. Each line in the file has the name of a city, its country, and its population. The first few lines of the file look like this:

Answers

Answer and Explanation:

Open your text editor and open new file. Save new file file as lastname_firstname_cities.py. The program will open the file cities.txt downloadfile hence :

dfile= open(cities.txt, "r")

If we write this into our lastname_firstname_cities.py file it will open our cities.txt downloadfile in read mode and text mode(by default unless we specify binary mode which is for images)

Write a C program that will load entries from a file containing details of books and prints them.

Program Requirements:
a. Load file containing details of books
b. Print out all the books Required approach:

1. Design a struct/class that can hold the details of an individual book.
2. Dynamically allocate an array of these objects. The size should be the number of book entries from the input file given by the user.
3. Load all of the book entries into this array of objects before printing

Answers

Answer:

........

Explanation:

Explain the purpose of the open() and close() operations.

Answers

Answer:

The open() operation notifies the system that the named file is about to become active. The close() operation notifies the system that the named file is no longer in active use by the user who issued the close operation.

Chất xơ có nhiều trong thực phẩm nào?

Answers

Answer: rau củ quả đều có lượng chất xơ nhiều hơn so với các loại thực phẩn khác

Explanation:

I connected to an external hard drive to transfer some photos from my vacation. When I try to drag the photo, it bounces right back and does not transfer. What is the likely cause of this issue?

a. hard drive is full

b. photos were taken in a different country

c. USB port is broken

d. the file structure of the 2 hard drives are not compatible

Answers

Your answer is D.

Hope this helps and if you could answer the question I just uploaded titled giving brainliest that would be great. Basically, what you have to do is research why the book titled the list of things that will not change and explain why it’s your favorite book based on the message it tells you! Go to my profile and go to questions.

The answer is D, What is the likely cause of this issue is that the file structure of the two hard drives are not compatible.

The file structure or file system, of a hard drive, tells the disk how to read, write and store information on the drive. Some file systems do not allow the disk to store any files and often do not display error messages. If we try to drag a file onto a hard drive with this kind of file structure, the action would simply not be performed. This can be fixed by formatting the disk partition into a new file system.

Option B states that the issue may be that the photos were taken in a different country. This is not the cause of the problem because regardless of where the pictures are taken, they are all stored in common formats such as:

JPEGPNGJFIF

Any external hard drive capable of storing images will have the ability to receive files in these formats as well as many other image formats. For this reason, option B is False.

The question states that you were able to connect the external Hard drive and drag files onto it, though unsuccessfully. This tells us that the USB port is working as intended, if it were not working, it would not display the Hard drive onto the computer and we would not be able to drag files to it. Therefore, option C is false

Insufficient Hard drive storage space is a common issue in not being able to transfer files between hard drives. However, if this were the case, the user would be shown a message displaying the error. The message may look like:

"Insufficient space on the disk.""The Disk is full.""Not enough memory to complete this action"

The exact wording may vary depending on the operating system in use. Since the question states that the files simply "bounces back" without an error message displaying, we can infer that option A is false.

For more help with Hard drive issues see: https://brainly.com/question/14254444?referrer=searchResults

Type the correct answer in the box. Spell all words correctly.
Which testing requires coding the test cases into a scripting language?
testing requires coding the test cases into a scripting language.

Answers

Answer:

sorry I forgot it

Explanation:

because I am now in a last position

Select the correct statement(s) regarding IP addressing.
a. IPv4 and IPv6 addressing is fully compatible with one another.
b. CIDR address format represents a Class C network only used within an intranet.
c. Subnet masks are used with both class and classless IP addresses.
d. all statements are correct.

Answers

Yeah the answer is b

Subnet masks are used with both class and classless IP addresses is the correct statement. Therefore, the correct option is C.

What is an IP address?

A device on the internet or a local network may be identified by its IP address, which is a special address. The rules defining the format of data delivered over the internet or a local network are known as “Internet Protocol,” or IP.

Only C is correct, rest other statements are incorrect because:

a. IPv4 and IPv6 addressing is fully compatible with one another is incorrect. While IPv4 and IPv6 can coexist on the same network, they are not fully compatible with one another.

b. CIDR address format represents a Class C network only used within an intranet is incorrect. Classless Inter-Domain Routing (CIDR) is a technique used to allocate IP addresses more efficiently.

Therefore, subnet masks are used with both class and classless IP addresses is the correct statement. Therefore, the correct option is C.

Learn more about,  here

https://brainly.com/question/3805118

#SPJ6

If you are to enhance the ICT used by your teachers, how will ypu do it? Will you use the same ICT or will you modify how it was integrated?​

Answers

To enhance the ICT (Information Communication Technology) used by teachers, I will modify how the ICT was integrated.

The modification of how ICT is integrated will change the culture that places teaching over technology.  Then, teachers will be taught how to use ICT to:

improve learning so that teachers become learning facilitatorsmotivate learners by fostering learning autonomy, making students less dependent on the teacherengage the learners by creating collaborative learningdiminish content learning so that students learn to think, create, and communicate effectivelymake learning a lifetime culture enhance the learning environment so that teachers become collaborators and co-learners with students.

Thus, I will enhance the ICT used by teachers by modifying its integration to achieve better results for both teachers and learners.

Learn more about the importance of ICT here: https://brainly.com/question/13724249

How to prepare and draw a corresponding flowchart to compute the sum and product of all prime numbers between 1 and 50

Answers

Answer:

Create boxes with the following content

Initialize sum to 0, product to 1 and number to 1Check if number is a prime. If yes, update sum += number and product *= numberIncrease number by 1If number is <= 50, go back to "check" block.

The check block has a diamond shape.

At the "yes" branch of the check block, you can create separate blocks for updating the sum and the product.

Connect the blocks using arrows.

Indicate the start and the end of the flow using the appropriate symbols.

The block to check if a number is a prime you could further decompose into the steps needed to do such a check.

hi, please help me.solution.​

Answers

Answer:

aahdbdnsjajaissjdjdhskakwjdhbebs

An error due to wrong input by the user

Answers

Answer:

when did it take place..

In the home tab under the paragraph group of options what are you unable to do?

Answers

Im not sure what this is?? Maybe add a picture or more context! ❤️

Argue whether we can infer anything about a candidate’s ability to work in a professional environment based on his or her resume’s formatting.
Compare how you would address a resume with wacky fonts to how you would respond to grammatical errors in a resume.

Answers

Answer:

when dressing feaded back is postive and then list areas of inprovmenr to met the job requirements

Explanation:

What is indirect program memory addressing? Explain the working of the following instructions?

a) JMP AX
b) JMP LIST[DX]
c) JMP NEAR PTR[DI+3]

Answers

Indirect main memory addressing is described as the method in which the variable's address is stored in a mind register and also a command is utilized to point towards the memory registers which hold the register. Instruction is used to direct towards a register that displays the results of the variables. The register, in turn, refers to that variable's address in simplistic words. As just a result, it is indeed considered a passive program, memory address.

The instructions operate as follows:

a)

JMP AX :

The JMP instruction is being used to execute an unconditional jump.AX is indeed the label's name. JMP AX codes are being used to transfer control of the flow program to the AX label.

b)

JMP LIST:

The JMP command can be used to execute an unconditional jump, JMP LIST[DX] is the label's name.  The JMP LIST[DX] program is being used to transfer control of its flow programs to the specified section. It is the segment to which the flow control is transmitted.

c)

JMP NEAR PTR[DI+3]: 

Unconditional jumps could be done with the JMP command as you'll see, the label is JMP NEAR PTR[DI+3]. It's being used to transmit flow control to a particular section, throughout this case [DI+3]. The close keyword indicates that perhaps the code segment would be in the line of code being nearby.

Learn more:

brainly.com/question/20320915

Which one is the result of the ouWhen you move a file to the Recycle Bin, it will be immediately deleted from your computer.

A. True

B. Fals

Answers

Answer:

B => false

Explanation:

it just keep it on recycle bin => not being removed

False

Explaination :

The deleted file will stay in Recycle Bin for a short period of time before it's permanently deleted from your computer

mk chưa hiểu nên các bạn giúp mk vs

Answers

Answer:

my tab and state it all over my name to

Write a program that asks the user to enter in a username and then examines that username to make sure it complies with the rules above. Here's a sample running of the program - note that you want to keep prompting the user until they supply you with a valid username:

Answers

user_in = input ("Please enter your username: " )

if user_in in "0123456789":

print ("Username cannot contain numbers")

elif user_in in "?":

print ("Username cannot continue special character")

else:

print (" Welcome to your ghetto, {0}! ".format(user_in))

What’s cloud-based LinkedIn automation?

Answers

Answer:

Cloud based LinkedIn automation includes tools and software that run through the cloud-system and are not detectable by LinkedIn. Cloud based LinkedIn automation tools are becoming the favorite among B2B marketers and sales professionals as they are giving the desired outcomes without any effort.

Other Questions
4.a. The total area of the model is 130 m2. Write an equation to find x. b. Solve the equation by completing the square.A. (x + 2)(2x + 2) = 130; x = 5.12 mB. (x + 2)(2x + 2) = 130; x = 6.70 mC. (x + 2)(x + 2) = 130; x = 9.40 mD. (x + 2)(2x + 2) = 130; x = 6.58 m please solve both match the following and true or false i need to submit describe three ways that the atmosphere helps living things survive on earth. include information in your answer about the characteristics of the different layers During a recent hurricane, 25 individuals of the same butterfly species were blown onto a barrier island in southern Florida. Prior to this event, this species did not inhabit the island, but with the ample vegetation on the island and a lack of predators, the displaced individuals were able to survive and reproduce. When the butterflies initially arrived on the island, they did not have to compete for food or space. What type of population growth did they likely exhibit What is the range of g ( x ) = 3x 2, if the domain is { 1, 0, 1, 2 }? Which of the following would best be solved using factoring by grouping?3x^2 + 12x = 8 or x^2 + 3x - 10 = 0 or x^2 = 25 or x^3 + 5x^2 - 9x - 45 = 0 _______ involves giving employees more opportunity to experience achievement, responsibility and advancement. A ball is thrown into the air. The path it takes is modeled by the equation: -3t+24t = h, where t is the time in seconds and h is the height of the ball above the ground, measured in feet. Write an inequality to model when the height of the ball is at least 36 feet above the ground. For how long is the ball at or above 36 feet? please evaluate P(7,1) A convex mirror of radius of curvature 1.6 m has an object placed at a distance of 1.0 m from it. Find the position of image and the magnification. Find BD, given that line AB is the angle bisector of < CAD. monica wants to write step by step instructions to teach new students how to unlock their lockers at school. which text structure would best help monica Determine the area of the given parallelogram with length 11 and altitude five A blackbody radiator was expected to give off energy of increasing frequencyas its temperature increased. Which of the following ideas provided animportant step toward understanding why this was not observed?A. Light is quantized and must be absorbed as a unit.B. Electrons can act as both waves and particles.C. Matter is quantized and cannot be broken down.D. Large objects can be viewed as acting as waves. help asap! what does sin= if x=2+5 find the value of x-1/x Find the length of BCA. 6.81B. 7.64C. 13.37D. 29.44 What is the initial value of the function represented by this graph? 1 5 6 7 The Indianapolis speedway consists of a 2.5 mile track having four turns, each 0.25 mile long and banked at 9 12' Find x please explanation need it