ITCS114 Assignment 2 - Arrays Part (1): Write a Java program to do the following: 1) Ask the user to enter a positive integer (n). Ask the user to renter n in case a negative value is entered. 2) Create an array named list of size (n) integers 3) Ask the user to enter (n) integers and store them in the array list. 4) Ask the user to enter an integer x. 5) Print all even numbers below x Example: Enter an integer n: -5 Invalid size, Reenter a positive integer: 8 Enter 8 values: 11 2 3 -4 -15 6 9 10 Enter integer x: 7 Even numbers below 7: 2 -4 6
Q: not sure what you mean when you say "operating systems for resource-constrained devices." Explain it...
A: Solution:-
Q: Which of the following lines, when inserted into the proper event process, cancels the key pushed by...
A: Introduction: Explanation If a key is pressed within a control, then the “KeyPress” event will occ...
Q: Describe how organizational culture is related to project management. What type of culture do you th...
A: Organisational culture is related to project management in many ways.
Q: Explain two reasons why a national educational technology standard is required.
A: National Educational Technology Standards(NETS) are now known as the International Society for Techn...
Q: Define some value-returning function examples
A: Value returning functions are the functions that are having a return type other than void
Q: What is a learning system? Give an example of a learning system and explain
A: A learning system is basically an assortment of antiques that are 'united', in a proper way, to esta...
Q: What are some of the main reasons he gives for having a robust cyber defence?
A: Introduction: Defending your device, software, and network from cyberattacks or threats is what cybe...
Q: What are the benefits and drawbacks of distributed data processing that should be considered before ...
A: Intro Scattered data processing is a type of computer networking method where more than one computer...
Q: What are the steps for making a list?
A: Introduction: Lists, like other HTML5 components, are simple to create:
Q: Describe the downsides of the OSI Model.
A: Introduction :- The International Organization for Standardization (ISO) developed the open systems ...
Q: 3 Using a Truth table, determine the value of the compound proposition ((p∨ q) ∧ (¬p∨ r)) → (q ∨ r)
A: Note- As per the Bartleby policy, we have to attempt only one question.
Q: :the output of (Print "a", "b", "c") is abc O ab c abc
A: With respect to your question answer is given below:- According to the question, this double quote...
Q: What are some of the similarities and differences between strings and lists?
A: Introduction: Strings cannot be modified, but lists can. Second, list members can be of any type, bu...
Q: Explain the prerequisite briefly.
A: Introduction: the question is about prerequisite briefly and here is the solution in the next step.
Q: Multiply the value 32 (expressed by 8-bit signed two's complement representation) by 2 Divide the va...
A: 8) 32 x 2 = 64 8-bit signed 2's complement representation of 64 is 01000000
Q: Why are stack-based intermediate forms used by so many virtual machines?
A: Virtual machine code is also a medium-term format for virtual machine translators, who work for the ...
Q: What is the time complexity in Big-O for the following two Java code snippets? for(int i = 1; i <= n...
A: We know that the Time Complexity of a loop is considered as O(Logn) when loop variables are divided/...
Q: How many steps are involved in web design? Describe each stage and why it is important.
A: Introduction: Here we are required to explain each of the following steps that are involved in WEB d...
Q: The result of adding hexadecimal number A6 to 1A is * FO. О со. O EF Skip O EO. To convert the binar...
A: Note - As per our guidelines, we can provide solution only for one question. Since you have posted m...
Q: Apply bucket sort algorithm and sort the values given in the following array (B). 0 1 2 3 4 6 7 8 B ...
A: INTRODUCTION: In the given problem statement, we are asked to apply the bucket sort on one given set...
Q: Write a subroutine which copies a string starting from address $1100 to a location starting from add...
A:
Q: What exactly is modular programming? Make a list of all the details regarding returning and non-retu...
A: Intro C-programming: It is a procedural programming language that can be used for developing several...
Q: Explain briefly each of the cloud computing services listed below. In each service category, identif...
A: Application cloud services: A cloud application basically a kind of software application that is nee...
Q: what is the difference between a multpile regression modle and correlation using R-values
A: Multiple regression that can be define as that based on the two or more and another variable. In the...
Q: Question: Does the choice of the pivot affect the running time of quick sort? Why or why not? It wou...
A: Choosing a random pivot minimizes the chance that you will encounter worst-case O(n2) performance (a...
Q: Consider using BPEL or other business process modeling languages
A: Introduction: BPEL is a process modeling/management language that standardizes process descriptions ...
Q: How can you foresee and prepare for the many cyber security threats that may arise during the develo...
A: Introduction: Let's start with malware, the most common and broad sort of security threat. Since th...
Q: Create a java program that puts numbers as argument in the command prompt and display total positive...
A: Given: To write a Java program that puts numbers as argument in the command prompt and display total...
Q: Facilitator (FacilitatorID, LastName, FirstName, Street, City, ZipCode) Forum (ForumNum, ForumDate,...
A: Here the attribute customerNum of relation Forum corresponds to primary key FacilitatorID of relatio...
Q: If I want an interrupt to occur when the I/O pin PORT C pin 0 changes from high to low, which pin ch...
A: How many general purpose digital i/o ports are possible on ATmega328P? option (c-22) When used with ...
Q: a) Explain the term handle and illustrate with 3 examples how they are used in Windows system progr...
A: Here is the detailed explanation of the program
Q: Define and explain the role of a repository in the system development process.
A: Define : Repositories are defined as a collection of related files and content stored in one place ...
Q: Reverse an Array Use a loop with indirect or indexed addressing to reverse the elements of an intege...
A: Check the program screenshot for the correct indentation. Please check the source code and output in...
Q: There are two basic ways to design a well-structured relational database. The method in which a data...
A: A database system as the management system as the file of the processing as the based service of the...
Q: Which of the following instructions is impossible?
A: In this question, we are asked to give the correct answer out of many Given:
Q: Describe client/server design, including tiers, cost-benefit considerations, and performance.
A: Client/Server Architecture is generally refers to systems that divide processing between one of more...
Q: Use this exercise to develop the JavaScript code that will accompany th HTML code so that when a use...
A: the code is an given below ;
Q: Explain how to use Microsoft Excel's Goal Seek feature and construct a spreadsheet that demonstrates...
A: Introduction: When an input value is known only to the source, goal seeking is the process of determ...
Q: How is Binary Heap usually implemented?
A: Binary Heap is almost complete tree, that means in binary heap, every node contains two children exc...
Q: Define the term "root authority." Explain how it is used.
A: Intro If a certificate is issued by a trusted Certificate Root authority, it is called a Root SSL ce...
Q: What will happen if one create a new user,generate a home/user/.ssh/authorised_keys file, and then d...
A: Please find the answer and explanation in the following steps.
Q: What are the duties of computer professionals?
A: Computing Professionals: It includes hardware designers, software engineers, and database administra...
Q: VPNs employ encryption techniques to ensure security and privacy when connecting remotely over a pub...
A: Introduction: VPN stands for "virtual private network," and it is a service that lets you keep your ...
Q: ssume you had a function named update) that updates shared data. Illustrate how a mutex lock named m...
A: Race condition is a situation in OS where two or more operation are being done at a same time. It l...
Q: Question 5 Scatter plots involve how many numerical data variables? one two three
A: Introduction: A scatter plot (Chambers 1983) displays the correlations or associations that exist be...
Q: Example-3: Write a program to calculate the Area and volume for a sphere. Sol. -The area of sphere =...
A: C++ Program for above : #include <iostream> using namespace std; int main() { //get ...
Q: Write a short C program that declares and initializes (to any value you like) a double, an int, and ...
A: Format Specifiers in C They define the type of data that is to be printed on standard output whi...
Q: Discuss the concepts of artificial intelligence with virtual reality.
A: In recent years, we have attempted to improve AI algorithms so that they can act more human-likely, ...
Q: What does it mean to encode a signal?
A: Hello student Greetings Hope you are doing great. Thank You!!!
Q: Print Person Information from file In this lab you are asked to complete the function : print_person...
A: ########################## Complete this function#########################def print_person_from_file...
Java
Step by step
Solved in 2 steps with 1 images
- (Electrical eng.) Write a program that declares three one-dimensional arrays named volts, current, and resistance. Each array should be declared in main() and be capable of holding 10 double-precision numbers. The numbers to store in current are 10.62, 14.89, 13.21, 16.55, 18.62, 9.47, 6.58, 18.32, 12.15, and 3.98. The numbers to store in resistance are 4, 8.5, 6, 7.35, 9, 15.3, 3, 5.4, 2.9, and 4.8. Your program should pass these three arrays to a function named calc_volts(), which should calculate elements in the volts array as the product of the corresponding elements in the current and resistance arrays (for example ,volts[1]=current[1]resistance[1]). After calc_volts() has passed values to the volts array, the values in the array should be displayed from inside main().In C Programming Language Palindrome: “A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward, such as ‘madam’ or ‘kayak’” (excerpt from Wikipedia).Write a program that reads 8 words from Palindrome.txt and checks whether the word you read is a palindrome (please read its description above) or not. Print the index numbers of all the palindrome words in your array. You are required to read words character by character into a character array.• Write readFile function, which gets a file pointer and a two-dim array, to read each word(bunch of characters) line by line and store them into a two-dim character array.• Write findSize function takes a one-dim array and returns its actual size.• Write isPalindrome function takes a one-dim character array to check whether the content is a polindrome or not. If the word (character squence) is a palindrome, then it returns 1. Otherwise, it returns 0.5.Array _7 .Two-Dimensional ArrayInstruction:Create a java program that generates elements (randomly from 10 – 75) of a 2-dimensional array (5x5) using the Random Class then perform the following:1) Output the array elements2) Output the sum of prime numbers in the array3) Output the elements in the main diagonal.4) Output the sum of the elements below the diagonal.5) Output the sum of the elements above the diagonal.6) Output the odd numbers below the diagonal.7) Output the even numbers above the diagonal. NOTE: Please do not use the array methods available on the internet. Use .
- 5.24 LAB: Shift right (JAVA) Write a program in java that reads a list of integers from input into an array and modifies the array by shifting each element to the right one position and by shifting the last element to the first position. The input begins with an integer indicating the number of values that follow. Output the modified array and end with a newline. Ex: If the input is: 6 2 4 6 8 10 12 the output is: 12 2 4 6 8 10 For coding simplicity, follow every output value by a space, including the last one. Code starts here: import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int[] userValues = new int[20]; // List of integers from input /* Type your code here. */ }}Variables Primitive Write a java program that asks the user to enter 3 integers. Add the integers and display “The total is “ the result Reference Write a java program that asks the user for their first name and last name. Display “Your full name is “ the first name and last name Arrays One-dimensional Write a java program that creates an array of integers called numbers and contains five elements. Then use a for loop to print them out using println(). Two-dimensional submit your code for the total of rows and total of columns here//convert array of numbers from farenheit to celcius// example:// argument: [23, 32, 41, 50, 59]// return: [-5, 0, 5, 10, 15]// hint: use Array.mapfunction toCelcius(array){ } //write a function that takes an input array and returns an array of booleans (>=75) or fail (<75)// example:// argument: [20, 30, 50, 80, 90, 100]// return: [false, false, false, true, true, true]// hint: use Array.mapfunction passOrFail(array){ }
- 2.3 Write a program that allows you to create an integer array of 18 elements with the following values: int A[] = {3, 2, 4, 5, 6, 4, 5, 7, 3, 2, 3, 4, 7, 1, 2, 0, 0, 0}. Perform the following computations, a.Compute the sum of elements from index 0 to 14 and stores it at element 15 b.Compute the average of all numbers and stores it at element 16 c.Identifies the smallest value from the array and stores it at element 17 6.2 Create a Product class with Product Id & Product Name. Write a program to accept information of 10 products and store that in HashSet. Do following operations, a.Search a particular product in the HashSet.b.Remove a particular product from the HashSet by using product id.(Referbelow table for the product list) Product Id Product Name P001 Maruti 800 P002 Maruti Zen P003 Maruti Dezire P004 Maruti Alto 6.3 Implement LinkedListclass for this problema.Create an…3.8 LAB: Output numbers in reverse Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicating the number of integers that follow. For coding simplicity, follow each output integer by a space, including the last one. Assume that the list will always contain fewer than 20 integers. Ex: If the input is: 5 2 4 6 8 10 the output is: 10 8 6 4 2 To achieve the above, first read the integers into an array. Then output the array in reverse.Below is code which defines and creates an Array, myList: int [] myList = new int [5]; //define and createThe loop below stores the values 1 to 5 in myList:for (int i = 0; i < 5; i ++) {myList [ i ] = i + 1; //store values using a loop}The loop below prints the values from first to last in myList:for (int i = 0; i < myList.length; i++) { System.out.print(myList [ i ] + " ");}The code below is used to get user from the user and calculate the sum:import java.util.*;public class WhileWithInput {public static void main(String[] args) {Scanner reader = new Scanner (System.in);int count = 1; double total = 0; while (count <= 5) {System.out.println("Enter a decimal number"); double number = reader.nextDouble();total = total + number;count = count + 1;System.out.println("The total is " + total); }System.out.println("The total is " + total); }}1CPS 2231 Chapter 7 – lab 2 Fall 2019Use the examples on page 1 to complete the lab below. Please submit a screen print of the Eclipse editor…
- Part 1 The range of a set of values is the difference between the highest value and the lowest value in the set. Write a C/C++ program that prompts the user to enter N integer values and stores it in an array. Calculate and display the range of the values, as well as the largest and smallest values in the set. TIP: you can declare an array of size N by declaring the array after the user enters a value for N! Part 2 Write a C/C++ program that prompts the user to enter N integer values and stores it in an array. Display the array’s elements in reverse order. Part 3 Write a C/C++ program that prompts the user to enter N integer values and stores it in an array. Sort the elements of the array in ascending order. You may use any sorting algorithm.Daniel Liang 11 the edition Java 8.7 (Points nearest to each other) Listing 8.3 gives a program that finds two points in a two-dimensional space nearest to each other. Revise the program so that it finds two points in a three-dimensional space nearest to each other. Use a two-dimensional array to represent the points. Test the program using the following points:double[][] points = {{-1, 0, 3}, {-1, -1, -1}, {4, 1, 1}, {2, 0.5, 9}, {3.5, 2, -1}, {3, 1.5, 3}, {-1.5, 4, 2}, {5.5, 4, -0.5}}; of using double[][] inputArray() int[] closestPoints(double[][]) which returns an array containing the two line numbers of the closest points void displayClosestPoints(int, int)Problem Description - JAVA PROGRAMMING Use a Two-dimensional (3x3) array to solve the following problem: Write an application that inputs nine numbers, each of which is between 1 and 10, inclusive. Display the array after the user inputs each value. Rotate/flip the array by changing places. Make the rows columns and vice versa. You have to move the elements to their new locations. Remember to validate the input and display an error message if the user inputs invalid data. Documentation and the screenshot(s) of the results. Example: 1 2 3 4 5 6 7 8 9 the result will be : 1 4 7 2 5 8 3 6 9