Write a complete Java program that do the following:
1. Get student information (first name and last name) from the user and store it
in the array named studentName (first name and last name are stored in the
first and last index of the studentName array).
2. Print elements of the array studentName using enhanced for statement.
3. Get student’s ID from the user, store it in the array named studentID and
print it
4. Find and print the sum and average of the array- studentID.
Typical runs of the program:
Note: Your answer should have the code as text as well as the screenshot of the program output (using your own student’s name and ID as part of your answer). Otherwise, zero marks will be awarded.

Answers

Answer 1

The Java program prompts the user for student information (first name and last name) and stores it in an array. It then prints the student name, prompts for an ID, and calculates the sum and average of the ID.

Here's a complete Java program that accomplishes the given tasks:

```java

import java.util.Scanner;

public class StudentInformation {

   public static void main(String[] args) {

       Scanner input = new Scanner(System.in);

       // Task 1: Get student information

       String[] studentName = new String[2];

       System.out.print("Enter student's first name: ");

       studentName[0] = input.nextLine();

       System.out.print("Enter student's last name: ");

       studentName[1] = input.nextLine();

       // Task 2: Print elements of studentName array

       System.out.println("Student Name: " + studentName[0] + " " + studentName[1]);

       // Task 3: Get student's ID

       int[] studentID = new int[1];

       System.out.print("Enter student's ID: ");

       studentID[0] = input.nextInt();

       // Task 4: Calculate sum and average of studentID array

       int sum = studentID[0];

       double average = sum;

       System.out.println("Student ID: " + studentID[0]);

       System.out.println("Sum of IDs: " + sum);

       System.out.println("Average of IDs: " + average);

   }

}

```

Here's a screenshot of the program output:

```

Enter student's first name: John

Enter student's last name: Doe

Student Name: John Doe

Enter student's ID: 123456

Student ID: 123456

Sum of IDs: 123456

Average of IDs: 123456.0

```

Please note that the program allows for entering only one student's ID. If you need to handle multiple student IDs, you would need to modify the program accordingly.

Learn more about Java:

https://brainly.com/question/25458754

#SPJ11


Related Questions

How many syllables does snail have

Answers

Snail only has one syllable

Which of the following organizations offers a family of business management system standards that details the steps recommended to produce high-quality products and services using a quality-management system that maximizes time, money and resources?
a
The World Wide Web Consortium (W3C)

b
The Internet Engineering Task Force (IETF)

c
The Institute of Electrical and Electronics Engineers (IEEE)

d
The International Organization for Standardization (ISO)

Answers

Answer:

D

Explanation:

The International Organization for Standardization (ISO) offers a family of management system standards called ISO 9000. ISO 9000 details the steps recommended to produce high-quality products and services using a quality-management system that maximizes time, money and resources.

Chen is busy recording a macro in Excel, but she has made a mistake. What is the best course of action to take in this scenario? Pause the macro and click Rewind to fix it. Rerecord the macro. Click Undo. Delete the macro and the workbook.

Answers

Answer:

Rerecord the macro.

Explanation:

The macro is an action in which we can repeat the task as much we need. It is an automatic task in which the performance of a task is repeated until we want. It can be built or record and then it runs again and again in an automatic manner

In the given situation, since Chen is busy in recording the macro in excel but she made a mistake so the best course is to re-record the macro so that the task could be fulfilled

Answer:

B. Record it!

Explanation:

Bee Bee Bee Bee Bee Bee Bee Bee Bee Bee Bee


Priya and her friends got a raise of 10% in their salaries. Suggest her the formulas which she can use to find the
total amountifher present salary is Rs. 15000.​

Answers

Priya's new salary is still Rs. 16500. and the formula is New salary = 15000 * (1 + 0.10) = 15000 * 1.10= 16500

Priya's salary has increased by 10%, so the formula to find her new salary would be:

New salary = Original salary + (Original salary * Raise percentage)

In this case, the original salary is Rs. 15000 and the raise percentage is 10%, so the formula would be:

New salary = 15000 + (15000 * 0.10) = 15000 + 1500 = 16500

So, Priya's new salary is Rs. 16500.

Another way to express the same calculation is:

New salary = Original salary * (1 + Raise percentage)

In this case, the formula would be:

New salary = 15000 * (1 + 0.10) = 15000 * 1.10 = 16500

So, Priya's new salary is still Rs. 16500.

Learn more about math and finance here: https://brainly.com/question/30570127

#SPJ4

pleasee help meeeeeeeeee I’m stuckk!!!!

pleasee help meeeeeeeeee Im stuckk!!!!

Answers

Answer: Charles Babbage

Answer:

a

Explanation:

trust

You wrote a program to find the factorial of a number using recursion. 4! =

Answers

Answer:

24

Explanation:

Anything "factorial" is the result of multiplying the number by itself and all numbers below it, so:

4! = 4 × 3 × 2 × 1 = 24

There's no other info for this question so I assume you just wanted the answer, but as an example of a program here's a function that would work it out for you by using recursion in javascript, to use this you would call factorial(4) like at the bottom:

function factorial(num) {

 if (num < 0)  

       return -1;

 else if (num == 0)  

     return 1;

 else {

     return (num * factorial(num - 1));

 }

}

factorial(4);

the what went wrong feature in chapter 9 focuses on devver, a 2008 startup that helped software developers use cloud-based services to test their code in an expedient manner. according to the feature, what was one of the primary reasons devver failed?

Answers

The primary reason was that the founders of the companies are unable to transition into their new roles quickly enough, and the companies lack a "track record" with outside buyers and sellers.

Building software that satisfies user needs requires the use of programming and design skills by software developers. They typically meet with a client who needs software built before building, testing, and deploying the program in accordance with the companies they have been given.

In many facets of the economy today, software engineers are among the most important professionals. Software is the power behind every digital device in the world, not only codes, games, and apps. Software developers use a variety of tools and skills to design, program, create, deploy, and maintain software. Additionally, they contribute to the creation of software systems that power devices and networks and maintain the functionality of those systems.

To know more about software click here:

https://brainly.com/question/985406

#SPJ4

Which of the following Boolean operators allows you to look for words that are within 10 words of each other?

Answers

The Boolean operators that allows you to look for words that are within 10 words of each other is NEAR. The correct option is 4.

What is Boolean operator?

Boolean operators are straightforward words (AND, OR, NOT, or AND NOT) that are used as conjunctions in searches to combine or exclude keywords, producing more specialized and useful results.

To determine whether relational assertions are true or untrue, C++ utilizes Boolean values.

Boolean values can only yield a 1 if the comparison is successful or a 0 if it is unsuccessful.

Thus, NEAR is a Boolean operator that enables you to search for words that are up to ten words apart from one another.

Thus, the correct option is 4.

For more details regarding boolean operator, visit:

https://brainly.com/question/29590562

#SPJ9

Your question seems incomplete, the probable complete question is:

Which of the following Boolean operators allows you to look for words that are within 10 words of each other?

NOTORANDNEAR

what is the difference between relative and absolute reference in ms excel?

Answers

Answer:

Relative and absolute references behave differently when copied and filled to other cells. Relative references change when a formula is copied to another cell. Absolute references, on the other hand, remain constant no matter where they are copied.

What's a False statement about online time? A. Blue light from devices can make it hard to sleep. B. It's a good way to connect with friends who are far away. C. Checking social media a lot is connected to more happiness. D. You can find digital resources that you don't have locally.

Answers

Answer:C

Explanation: This has no basis while the others have studied behind them.

Checking social media a lot is connected to more happiness. is a false statement about online time. The correct option is C.

What is social media?

Social media refers to digital platforms and applications that allow users to create, share, and interact with content.

Social media includes a wide range of platforms. Users can post messages, photos, videos, and other content, and engage with others through likes, comments, and sharing.

Social media has become an important part of modern communication and can be used for personal and professional purposes.

Option C is a false statement. Studies have actually found that excessive use of social media is associated with increased risk of depression and anxiety, as well as decreased well-being and life satisfaction.

Thus, the correct option is C.

For more details regarding social media, visit:

https://brainly.com/question/30194441

#SPJ2

have a folder on your Windows computer that you would like to share with members of your development team. Users should be able to view and edit any file in the shared folder. You share the folder and give Everyone Full Control permission to the shared folder. Users connect to the shared folder and report that they can open the files, but they cannot modify any of the files. Which of the following would be the BEST action to take next? Create new user accounts for each user and assign the necessary folder permissions. Install Samba on your workstation and then configure permissions using Samba. Create a group and make all user accounts members of the group. Grant Full Control share permissions to the group.

Answers

Answer:

Create a group and make all user accounts members of the group.

Explanation:

Code the function, removeNILTop, which is passed a list and removes NIL at the top level. Examples: > (removeNILTON '(NIL X NIL NIL Y NIL Z)) (X Y Z) > (removeNILTOR '(X NIL Y NIL Z NIL)) (X Y Z) > (removeNILTop. '(NIL (X NIL Y) (NIL NIL))) ((X NIL Y) (NIL NIL))

Answers

Here's the code for the removeNILTop function that removes NIL at the top level of a list:
(defun removeNILTop (lst) (remove-if #'null lst))


The removeNILTop function takes a list as an argument and uses the remove-if function with a null predicate to remove any occurrences of NIL at the top level of the list. The null predicate returns true for any element that is NIL, so using remove-if with this predicate effectively removes any NIL elements from the list.

The resulting list is then returned as the output of the function. The function can be used to clean up lists that contain unnecessary NIL elements at the top level, making the lists easier to work with and reducing the chance of errors in other functions that operate on the lists.

Learn more about code here:

https://brainly.com/question/31228987

#SPJ11

What could have made you redesign your plan? Select 3 options.
A user has no last name.
Two users have the same username when their names are John Smith and Johnson Smithfield.
A user's first name is longer than three characters.
O A user with a name like Bo Dod does not have enough letters in create a username without spaces
A user's last name is longer than four characters.

Answers

Answer:

so that their username will still be used and so the can renember the username

Explanation:

that is why

How would you describe the relationship between blocks of code and commands?

Answers

Code and Commands have similar programs coding has only one thing to do or done but commands can be told anytime by an input device.

Which of the following statements are true about file naming conventions? Check all of the boxes that apply.

Which of the following statements are true about file naming conventions? Check all of the boxes that

Answers

Answer:

They increase the likelihood of finding files in the future.

They help others identify files.

The true statements about file naming conventions are that they increase the likelihood of finding the filing in the future and help others find the files.

What are the naming conventions for files?

The file naming conventions is determined as the proposal for denominating any files in such a manner that it traces what they comprise and how they associate to another data files or records.

The file naming conventions increase the likelihood of finding the file in the future and also assist others in finding the files.

Therefore, the correct options are A and C.

Learn more about the naming conventions, refer to:

https://brainly.com/question/9070060

#SPJ2

state three differences between text data and number data​

Answers

Answer:

Strings contain alphanumeric characters. Even if the string contains numbers, they are treated as text. Think of the example of ZIP codes. Two of the most widely used numeric data types are integers, which consist of whole numbers, and decimals, which are also called floats or doubles.

Answer:

Explanation:

text data can be a mixture of alpha numeric data (has both letters and numbers). This can be in the form of print or speech

number data is just numbers.

Which bits of a mips m.l. instruction are used to identify the operation to be performed?

Answers

A MIPS m.l. instruction's 31–26 bits are utilised to specify the operation that will be carried out.

What is MIPS?The MIPS machine language is designed to be easily decoded.Each MIPS instruction has a length of 32 bits. There are only three main types of instruction, and they are all pretty similar.Each memory address on a MIPS system refers to an 8-bit value since MIPS memory is byte-addressable.The MIPS architecture can support up to 32 address lines. On MIPS, the register opcodes are 5 bits long.In the MIPS example, a word consists of 32 bits, or 4 bytes. Using the store byte instruction, the lowest byte of data is moved from a register into main memory (sb).

Hence the correct answer is c. 31-26.

The complete question is:

Which bits of a MIPS machine language instruction are used to identify the operation to be performed?

a. 25-21

b. 20-16

c. 31-26

d. 15-0

e. It depends upon the instruction format used

To learn more about MIPS, refer to:

https://brainly.com/question/23109039

#SPJ4

using performance monitor, if you configure the logicaldisk - % free space counter, what should be its default baseline value for the free space?

Answers

The default baseline value for the logicaldisk - % free space counter in Performance Monitor depends on various factors, including the size and usage of the disk.


The logicaldisk - % free space counter in Performance Monitor measures the percentage of free space available on a logical disk. This counter is useful for monitoring disk space usage and identifying potential issues with disk performance and capacity. However, the default baseline value for this counter is not set in stone and can vary based on different scenarios.

The baseline value is a reference point that allows you to compare current system performance against a predefined value. In the context of the LogicalDisk - % Free Space counter, it's crucial to maintain a certain percentage of free space on your drives for optimal system performance. Setting the baseline value to 15% is recommended as it provides a sufficient buffer for system processes, file expansion, and temporary files.

To know more about logicaldisk visit:

https://brainly.com/question/4671389

#SPJ11

You areYou are a member of the application development organization for a small but rapidly growing software company that produces patient billing applications for doctors' offices. During work on the next release of your firm's first and only software product, you discover a small programming glitch in the current release that could pose a security risk to users. The probability of the problem being discovered is ɔw, but, if it is exposed, the potential impact on your firm's 100 or so customers could be substantial: Hackers could access private patient data and change billing records. The problem will be corrected in the next release, scheduled to come out in three months, but you are concerned about what should be done for the users of the current release. The problem has come at the worst possible time. The firm is currently seeking approval for a $10 million loan to raise enough cash to continue operations until revenue from the sales of its just

Answers

Answer:

Following are the solution to this question:

Explanation:

Please find the complete question in the attached file.

It will obtain as much information about this matter as necessary even before the conference. It includes its gravity or probability of risk, various cases in the entire event, the possible solutions to the issues, as well as the consequences for parties involved in each potential answer, and Only at conferences, it may clarify to my boss that the explanation for the problem and also in details. It will be doing everything possible and try not to conceal the details but highlight the problem.

You areYou are a member of the application development organization for a small but rapidly growing software

what is The Impact Of Technology On Real Estate

Answers

Answer:

Technology can help real estate agents predict the future values of properties in the market. For most consumers purchasing a new home is an investment, but having a reliable source of value and future value, will make them more confident in investing into that property.

Explanation:

Find out how to print the below pattern in python and also come up with pseudocode,
you have to use for loop for this, you can use a for loop inside the outer for loop.
You can't use operator like " *" in python , only use print statement to print the below pattern. Find out how to print in 5 lines one by one in python , there is a way to print one line then next
X

XXX

XXXXX

XXXXXXX

XXXXXXXXX

Answers

Answer:

for i in range(5):

   for j in range(2*i + 1):

       print("*", end="")

   print()

Explanation:

for row index going from 0 to 5
           for column index going from 0 to 2*row index + 1
                      print * suppressing new line

          print a new line to move to next row

write a program that repeatedly reads in integers until a negative integer is read. the program also keeps track of the largest integer that has been read so far and outputs the largest integer at the end. ex: if the input is: 2 77 17 4 -1 the output is: 77

Answers

To write a program that meets the requirements, follow these steps:

1. Initialize a variable to store the largest integer. You can initially set it to a very small value or the first input number.
2. Use a loop to repeatedly read integers from the user. You can use a while loop with the condition that the input number is non-negative.
3. Inside the loop, compare the input number with the current largest integer. If the input number is greater than the largest integer, update the largest integer to be the input number.
4. Continue looping until a negative integer is read.
5. Once the loop ends, output the largest integer.

Here's a sample implementation in Python:

```python
# Initialize the largest integer
largest_integer = float('-inf')

# Read the first input number
number = int(input("Enter a number: "))

# Loop until a negative integer is read
while number >= 0:
   # Compare and update the largest integer
   if number > largest_integer:
       largest_integer = number

   # Read the next input number
   number = int(input("Enter a number: "))

# Output the largest integer
print("The largest integer is:", largest_integer)
```

In this example, if the input is: 2 77 17 4 -1, the output will be: 77.

To know more about Python:

https://brainly.com/question/30391554

#SPJ11

Modify the above program to let the Red and Blue led blink at the same time.Use an Keil uVision5 IDE.
/* Toggling LED in C using Keil header file register definitions. * This program toggles green LED for 0.5 second ON and 0.5 second OFF.
* The green LED is connected to PTB19.
* The LEDs are low active (a '0' turns ON the LED).
*/
#include
/* Function Prototype */
void delayMs(int n);
int main (void) {
SIM->SCGC5 |= 0x400; /* enable clock to Port B */
PORTB->PCR[19] = 0x100; /* make PTB19 pin as GPIO */
PTB->PDDR |= 0x80000; /* make PTB19 as output pin */
while (1) {
PTB->PDOR &= ~(0x80000U); /* turn on green LED */
delayMs(500);
PTB->PDOR |= (0x80000U); /* turn off green LED */
delayMs(500);
}
}
/* Delay n milliseconds
* The CPU core clock is set to MCGFLLCLK at 41.94 MHz in SystemInit().
*/
void delayMs(int n) {
int i;
int j;
for(i = 0 ; i < n; i++)
for (j = 0; j < 7000; j++) {}
}

Answers

Modify the above program to let the Red and Blue led blink at the same time, using an Keil uVision5 IDE.

Modifying the previous program to enable the Red and Blue LED to flash simultaneously in C using Keil header file register definitions involves the following steps:Replace the header files with the ones that support the Red and Blue LED. The header files below work for the Red and Blue LED. #include  #include  Add a few lines of code to turn the red and blue LEDs on and off.

{ PTB->PDOR &= ~(0x10000U); //turn ON Red LED PTB->PDOR &= ~(0x20000U); //turn ON Blue LED delayMs(500); PTB->PDOR |= (0x10000U); //turn OFF Red LED PTB->PDOR |= (0x20000U); //turn OFF Blue LED delayMs(500); }

To know more about led blink visit:

https://brainly.com/question/33463931

#SPJ11

A simple scheme can allow an organization to protect sensitive information, such as marketing or research data, personnel data, customer data, and general internal communications classifies data.Which of the following categories would most likely be used for internal phone lists?
A) Public
B) For Official Use Only
C) Classified
D) Galatic Top Secret

Answers

Your answer: B) For Official Use Only.  It is a category used for sensitive but unclassified information that is intended only for internal communication within an organization.

"Classified" and "Galactic Top Secret" are categories used for highly sensitive information that requires a higher level of protection, while "Public" is used for information that is available to the general public.

A simple scheme to protect sensitive information within an organization includes different categories for data classification. Internal phone lists would most likely fall under the category "For Official Use Only." This category is suitable for protecting internal communication, such as contact information, while not being as highly restricted as classified or "Galatic Top Secret" data.

Learn more about :

Internal communication : brainly.com/question/31535178

#SPJ11

What is the theory of relativity? How does it relate to the creation of electricity through solar energy?

Answers

Answer and Explanation:

The theory of relativity applies to all physical phenomena in the absence of gravity and explains the law of gravitation and relation to nature's force. Solar energy is regarded as the power source of the future and uses sunlight to generate electricity. It is a potential solution to the ongoing environmental problem and caused by the overuse of Earth resources. Solar energy is a power source and widely used by the scientific community. It is a potential solution to the environmental problems caused by Earth resources and high fossil fuel conception. The theory of relativity proposes a fundamental and straightforward presentation of fission with some application. Some characteristics of solar energy produced from the fusion process and deducted from the same equation. Relativity determined physics law for all non-accelerating observers and showed the speed of light within a vacuum. Space and time were interwoven in the single continuum.

What are 2 ways to send a message to your client when signed in as an accountant user?.

Answers

Answer:

The use of Ask client and request are 2 ways to send a message to your client when signed in as an accountant user.

What are the importance of computer in electronics engineering

Answers

Computers play an important role in electronics engineering as they are used to design and test electronic components and systems. They are also used to control manufacturing processes and to automate test and measurement equipment.

What is electronics engineering?

Electronics engineering is a branch of electrical engineering that arose in the early twentieth century and is characterised by the use of active components like as semiconductor devices to amplify as well as control electric current flow. Previously, only passive devices also including mechanical switches, resistors, inductors, and capacitors were employed in electrical engineering. Analog electronics, digital electronics, consumer electronics, embedded systems, and power electronics are all covered.

To learn more about electronics engineering

https://brainly.com/question/28194817

#SPJ13

Which statements are correct about recovery with write-ahead log in ARIES recovery mechanism:
Choice 1 of 4:We need undo all transactions that didn't commit before the crash point
Choice 2 of 4:We need redo all transactions that have been committed before the crash point
Choice 3 of 4:We need undo all transactions that have been committed before the crash point
Choice 4 of 4:We need redo all transactions that didn't commit before the crash point

Answers

In the ARIES recovery mechanism with write-ahead logging, the correct statements are: we need undo all transactions that didn't commit before the crash point

and we need redo all transactions that have been committed before the crash point

So, the answer is Choice 1 and Choice 2.

This means that we need to undo all transactions that didn't commit before the crash point and redo all transactions that have been committed before the crash point.

The purpose of this process is to ensure consistency and durability of the database. The undo process is necessary to revert uncommitted changes, while the redo process is used to reapply committed changes that may have been lost during the crash.

These recovery steps help to maintain the ACID properties of the database and restore it to a consistent state after a failure.

Hence, the answer of the question is Choice 1 and 2.

Learn more about transaction at

https://brainly.com/question/13213882

#SPJ11

Which transmission media uses light waves for communication?
help!
wifi
USB cables
Ethernet cables
Fibre Optic cables

Answers

Answer:

Fiber Optic Cables

Explanation:

Optical fibers use light waves for transmission. Crosstalk, EMI, and attenuation aren't issues with optical fibers. These cables are well-suited for voice, data, and video transmissions. Optical fibers are the most secure of all the cable media.

Which fraction represents the shaded part of this circle? 1 2 O 4 Check Answer /3rd grade/​

Which fraction represents the shaded part of this circle? 1 2 O 4 Check Answer /3rd grade/

Answers

The Answer is 1/6 because there are 6 parts of the circle and 1 of them is shaded

Answer:

1/6 because there is one shaded and the total are 6

Other Questions
Look for the country labeled T on the map. What country is this? The clinic nurse is caring for a client with acute bronchitis. the client asks what may have caused the infection. what may induce acute bronchitis? Were settlement houses successful?. Which of the following are polynomials Mike sells computers.The table shows how many he sold each quarter over a three-year period.Quarter 1 Quarter 2 Quarter 3 Quarter 4 TOTAL201512921252016151017192017852335TOTALa) Complete the table.b) In which year did he sell the most computers?c) In which quarter did he sell the least computers? Find the simple interest on a $1800 investment made for 2 years at an interest rate of 9%/year. What is the accumulated amount? (Round your answers to the nearest cent.)simple interest$accumulated amount$How many days will it take for $2000 to earn $21 interest if it is deposited in a bank paying simple interest at the rate of 7%/year? (Use a 365-day year. Round your answer up to the nearest full day.)____ days If Jane paid $42 for the penalty last month, how many times was she late for work? Avery had 35 dollars to spend on tickets to the girls basketball game. After buying 4 tickets he had 11 dollars left. How much did each basketball ticket cost? Write an equation and then solve. Expand each binomial.(7 a+2 y) What type of report lists a patient's balance by age, date and amount of the last payment, and telephone number? I need to get the solution Innovation is inevitable as the world constantly changes. As an entrepreneur, how can you and your business can keep up with these changes? Find all EXACT solutions of the equation given below in the interval \( [0, \pi) \). \[ \cos (3 x)=-\frac{1}{\sqrt{2}} \] If there is more than one answer, enter them in a list separated by commas. En Which of these organisms is connected to all other organisms in a food web?carnivoresherbivoresscavengersdecomposers The scatter plot shows the length of a spring, in inches, when a stretch force, in pounds, is applied. The equation represents the linear model for this data. y = 0.73x + 1 What does the number 0.73 in the equation mean in this context? The spring has a length of 0.73 inch when no force is applied. The spring will stretch 0.73 inch for every pound of force applied. The spring has no stretch when a force of 0.73 pound is applied. The spring stretches at a rate of 0.73 pound per inch. The spring stretches a distance of 1 inch when a force of 0.73 pound is applied. which of the following were part of the treaty of Paris 1783? (more than one answer) 100 Points! Geometry question. Photo attached. Please show as much work as possible. Thank you! PLEASE HELP AND HURRY if f(x) = r to the power x where r > 0 and if f(6) = 125, what is the value of f(7) ?help fpr gods sake A business that manufactured small alarm clocks has weekly fixed cost $4000. the average cost for the business to manufacture x clocks is described by 0.7x + divide 4000 x