Write a program in JAVA to input the number of elements in an array, also input the values in the array from the console. Replace all those elements which are even and greater than 5, with -99. Print the final array. Constraints: The array should initially not contain -99. The value of the number of elements should not be greater than 50.
Q: Are all problems in P solvable in a reasonable amount of time? Explain your answer
A: P Class. Polynomial Time is represented by the letter P in the P class. It is a set of choice issues…
Q: Which of these statements is incorrect: 0 One key is used for encryption and another for decryption…
A: Introduction: key to the public In cryptography, one set of keys was used for encryption, while a…
Q: What is the fundamental cause of scope creep in information systems design?
A: Introduction: The project will be completed with the help of Information System Design. A project is…
Q: How do we approach the design of system architecture and infrastructure in systems integration…
A: Intro: Analyze and create system infrastructure and architecture in a system integration project.…
Q: Why is there a layer for networks if they're already connected?
A: Given: The primary goal of this layer is to transport packets from the source to the destination of…
Q: i need the answer quickly
A: Let us see the answer below,
Q: Write a C++ program to find the most occurring element in an array of integers.
A: Program : #include<iostream>using namespace std; void most_occurred_number(int nums[], int…
Q: sub : Computer Networks sub : Computer Networks How does ATM work? Explain through diagram
A: The automated teller machine (ATM) is a type of automatic banking machine (ABM) that enables…
Q: Determine the difference between virtual memory and virtual machines. What are the distinctions…
A: In-memory computing: Allows a computer to compensate for lack of physical memory by transferring…
Q: Investigate access control via authentication and authorisation settings on an exemplar
A: The process of authenticating someone's identity is known as authentication. Biometrics, such as…
Q: a.Using the Google Meet platform as a practical example, discuss how it would be categorized under…
A: The Answer start from step-2.
Q: It is unnecessary to do integration testing if the individual applications have been extensively…
A: In the context of testing, the term "integration testing" refers to a type of testing in which…
Q: Write a Java program with screenshot output that does the Following: a. Print the numbers from 10 to…
A: a. Print the numbers from 10 to 1 (using while loop). b. Print the numbers (that are divisible by…
Q: 6. Create a function called word_intersection that prompts the user for two English words, and…
A: The user input will be string and then we have to parse them to set and then we can use intersection…
Q: Question 2: Class diagram with subclasses (generalization) (3%) Draw a class diagram with m
A: Class diagram for College Library Management System
Q: show how busy beaver function can be used to create non computable number
A: Introduction: show how busy beaver function can be used to create non computable number
Q: What is meant by the term "near-end crosstalk"?
A:
Q: Explain each of the four levels that make up the TCP/IP abstraction stack.
A: The four abstraction layers consist of the connection layer (lowest layer), Internet layer,…
Q: 6. Explain the runtime of breadth-first search algorithm?
A: Assume an adjacency list representation, V is the number of vertices and E is the number of edges.…
Q: What kind of representation does data have in Assembly Language?
A: A binary digit orbit is the smallest unit of information used in computing. Formed of binary digits,…
Q: pandas DataFrame, col
A: Given as, def calc_mean_mode(df, column_name): # your code here return calc_mean_mode(df,'Age')…
Q: Is it possible to have concurrency in operating system threading without parallelism?
A: yes, it is possible to have the concurrency in the operating system threading without the…
Q: Iverilog: casez and casex Using 4-bits for both input and output. Convert even numbers as its half…
A: According to the question our input and output must be in 4 bit binary and if the passed input is…
Q: Differentiate between security and controls
A: Answer the above question are as follows
Q: is defined as the mixture of different content forms such as texts, music, photos or images,…
A: Note: This is a multiple-question-based problem. As per company guidelines, only the first question…
Q: Whenever a file is saved to disk, the operating system is responsible for ensuring that the blocks…
A: Introduction: File systems may be used on a broad range of storage devices and on a number of…
Q: Unintegrated information systems cause a plethora of issues?
A: Information systems: The fact of the matter is that various worries and issues are caused by various…
Q: (b) Describe TWO (2) key differences between the activity bar chart and the staff allocation chart.
A:
Q: h to satisfy y
A: In its simplest terms, the risk assessment asks the question: if we don't change our behavior, what…
Q: Use YOUR NAME, SURNAME, and DATE as a variable in your answer. Write the program, which gives the…
A: Program :
Q: 10. Only the function in which they are defined is aware of local variables. Only the function in…
A: Functions in programs are defined so as to perform a certain task again and again whenever called.
Q: What does it mean to have a virtual private network?
A: Virtual Private Network: A virtual private network, or VPN, is a device-to-network Internet…
Q: It is possible to break down the Waterfall Systems Development paradigm into the following stages;…
A: Part(a) A sequential or linear approach to software development is used in the waterfall technique.…
Q: What is secondary memory, and what are its characteristics with instances, as well as its advantages…
A: What exactly is second memory? 1) Computer secondary memory Non-volatile, permanent memory that is…
Q: D. Consider f (x) = x' + 3x - 5, where [a = 1, b = 2] and -0.001.
A: x3+3x-5=0Let f(x)=x3+3x-51st iteration :Here f(1)=-1<0 and f(2)=9>0∴ Now, Root lies between 1…
Q: Write a function that determines the number of missing entries for a specified column in the…
A: Function is provided in the next step:
Q: Define the concept of Resource allocation ?
A: According to the question useful resource for the allocation this is a method of planning, managing,…
Q: Use the congruence C E (3p + 4) (mod 26) to decode the message E COWLS WLBSFI WTNA ET WFPSF LW…
A: The question is to decode the message using the given equation.
Q: Distinguish between a hub, a switch (bridge), and a router.
A: 1. Hub: A Hub is nothing more than a connection that joins the wires arriving from the various…
Q: Talk about how you would go about implementing MVC from the inside out. Using an MVC framework in…
A: MVC framework: MVC (Model-View-Controller) is a software design pattern used often to construct user…
Q: ld you need a crossover wire for a T1 con
A: Introduction: Below the describe why need a crossover wire for a T1 connection
Q: What exactly is a "composite data type" and how does it vary from a "atomic data type"?
A: Types of atomic data: Elements with no constituent components. • Types of composite data: A data…
Q: s(1 Consider a serial bus (1 bit wide) that runs at 2GHZ, using alternate cycles for control signals…
A: The Answer is in step-2.
Q: What role does Bayes' Theorem have in the operation of image resizing software?
A: This method allows us to resize the image. Picture Pre-preparing: This cycle aims to enhance the…
Q: Which of these statements is incorrect: O One key is used for encryption an another for decryption…
A: None of the given statements is incorrect.
Q: Write a program that keeps reading integers from the user until he enters a negative number. The…
A: import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc=new…
Q: Develop a C++ program to write text in the file. Read the text from file from end of the file.…
A: Approach Approach for solving this problem is very simple, all we have to do is to open a file, and…
Q: Operating systems make every effort to save consecutive blocks of a file on following disk blocks.…
A: Introduction: Hard discs are well suited for supplementary file system storage due to two…
Q: What distinguishes software engineering from other types of engineering and why is it considered an…
A: Given: The Software Engineering Process includes computer science, information technology, and…
Q: What is software engineering, and how is it distinct from other types of engineering?
A: Software engineering can be defined as a part of computer science that deals with the design,…
Write a program in JAVA to input the number of elements in an array, also input the values in the array from the console. Replace all those elements which are even and greater than 5, with -99. Print the final array.
Constraints: The array should initially not contain -99. The value of the number of elements should not be greater than 50.
Step by step
Solved in 2 steps with 2 images
- Complete the following program ArrayMax.java. The function max() should return a new array containing the max value of each corresponding value in two arrays. Below is the code, with the section that needs to be completed. The output should look exactly like what is given below, also2. Rotate Left k cells Use Python Consider an array named source. Write a method/function named rotateLeft( source, k) that rotates all the elements of the source array to the left by 'k' positions. You must execute the method by passing an array and number of cells to be shifted. After calling the method, print the array to show whether the elements have been shifted properly. Example: source=[10,20,30,40,50,60] rotateLeft(source,3) After calling rotateLeft(source,3), printing the array should give the output as: [ 40, 50, 60, 10, 20, 30]Code an exam in Java that repeatedly asks the user to enter the capital for a province in Canada. Then, the program should report whether the answer is correct. Eventually, you must display how many answers the user guessed correctly.The requirements are as follows: - Use a 2D array to hold the provinces and their capitals (as implied by the table below)- Answers are not case-sensitive (e.g. Toronto and tOrOnto are considered the same)
- Java Design two parallel array of 10 elements. One array will store the students’ names and the other array will store the exam’ s score as shown partially filled below. Please put more names and score when populating the arrays with proper data, print the names and scores of all students in class. As you can see there is a tie between Jeff and Nancy. Print the name and score of student(s) who got the highest score in class. (in this case we expect both Jaff and Nancy to be printed. Make sure your code works correctly if you change the location of the names of students.The Lo Shu Magic Square is a grid with 3 rows and 3 columns shown below. The Lo Shu Magic Square has the following properties: The grid contains the numbers 1 – 9 exactly The sum of each row, each column and each diagonal all add up to the same number. This is shown below: Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer type. Do not use two-dimensional array. Each one the arrays corresponds to a row of the magic square. The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not. Project Specifications Input for this project: Values of the grid (row by row) Output for this project: Whether or not the grid is magic square Processing Requirements Use the following template to start your project: #include<iostream> using namespace std; // Global constants const int ROWS = 3; // The number of rows in the array const int COLS = 3; // The number of columns…The Lo Shu Magic Square is a grid with 3 rows and 3 columns shown below. The Lo Shu Magic Square has the following properties: The grid contains the numbers 1 – 9 exactly The sum of each row, each column and each diagonal all add up to the same number. This is shown below: Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer type. Do not use two-dimensional array. Each one the arrays corresponds to a row of the magic square. The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not. Processing Requirements - c++ Use the following template to start your project: #include<iostream> using namespace std; // Global constants const int ROWS = 3; // The number of rows in the array const int COLS = 3; // The number of columns in the array const int MIN = 1; // The value of the smallest number const int MAX = 9; // The value of the largest number //…
- JAVAWrite a program that searches person's name and display all matched name. For example, if a user inputs the letter "Davis", the program searches all name which includes "Davis" in an array. Then, display all matched names on the screen. You must declare a single dimensional array which has all people’s name. Use methods of string classFor Beginners Java: Write a program that ask the user to enter a list of positive scores until the user enters a negative score to terminate the input. You need to store these scores in an array. You can assume the maximum number of scores the user may enter is 50. However, you need to keep track of the actual number of scores entered. Write 2 methods: 1. calculateAverage(): this method takes the list of scores and return the average score. 2. countPerfectScores(): this method takes the list of scores and return the number of perfect scores (100). The main program reads the input and calls these methods and print the results. Please make sure you write a comment line to document what your method does.Pseudocode for Java code Write the algorithm in pseudocode for a method that accepts three parameters: an integer array, an integer representing the number of valid values in the array, and an integer representing a factor. The method will count the number of valid values in the array that are multiples of the factor and will return the count. There is a Java operator that might be very helpful in solving this problem. Testing Above problem: Assuming that the first two parameters are an array containing 4, 10, 15, 12, 8, 20, 100, 25, 32, 7, 28, and 48 and the number 12, come up with three good test cases for the factor and the return value. factor numMultiples
- Write a java program: Question 1 Write a program that allows the user to enter name and grade until "QUIT" is entered for name. The grade should be a number between 0 and 100. If the user input of a grade is not in this range, you should ask the user to re-input the grade. Store all the names in an array called names, and all the grades in an array called grades. Print out all the names and the corresponding grades. For Example, Input Enter name: Alice Enter grade: 90 Enter name: Bob Enter grade: 80 QUIT Expected output Name: Alice, Grade: 90 Name: Bob, Grade: 80Write an application that stores nine integers in an array. Display the integers from first tolast, and then display the integers from last to first.Problem 1: Complete the sumOfDiagonals method in SumOfDiagonals.java to do the following: The method takes a 2D String array x as a parameter and returns no value. The method should calculate and print the sum of the elements on the major diagonal of the array x. In order to have a major diagonal, the array passed into the method should be a square (n-by-n), if it's not a square your program should handle that situation by throwing an exception. (Do Not worry about ragged arrays) If the array is a square, but there is a non-integer value on the major diagonal, your program should handle that situation by throwing an exception. When handling the exceptions, be as specific as you can be, (i.e. Do Not just use the Exception class to handle all exceptions in one catch block). Make the proper calls to the sumOfDiagonals method from the main method to test your sumOfDiagonals method on all the String arrays provided in the main method.