Write a Java Program to take an int n from the user & print the absolute difference between n and 51, except print double the absolute difference if n is over 51.
Q: Is it possible to define coupling and cohesion in the context of Object Oriented Programming Analysi...
A: Lets see the solution in the next steps
Q: Find out 0(f(n)) for the following and sort the following functions in the increasing order of asymp...
A: Order is: 17<logn <4logn<n<5n=5n<nlogn<n4
Q: 1. Write a program using switch statement to display the days of the week. For example if the user e...
A: Disclaimer: As per guidelines, we can only solve one question at a time. Hence resubmit the question...
Q: Provide the following instructions for writing an application that questions the user for two intege...
A: PROGRAM INTRODUCTION: Import the required libraries. Start the definition of the main function. Dec...
Q: Write a code to change the color of label text every 5 second randomly * Your answer (RND*100)= * Yo...
A: Find the answer with reason given as below :
Q: 1. What are functional requirements? 2. What are non-functional requirements? 3. What is software me...
A: - We need to talk about the terms asked.
Q: perform the following assignments, refer to the tables created in the JLDB_Build_5.sql script at the...
A:
Q: 2 Using Divide and Conquer technique, sort the given number using quick sort 9,1,3,5,2,6,4
A: Given:
Q: V. Round Robin and SJF comparison Process Arrival Time CPU Burst Time P1 9. P2 4 4 P3 6. 1 P4 8 6. F...
A: Given: We need to calculate the Average waiting time and turn around time of the given process . Usi...
Q: allow you to build two functions for multiplication as well as modulus. The two numbers must be pass...
A: Code: #include <iostream> using namespace std; int mul(int num1, int num2){ return num1*num...
Q: A local area network (LAN), as the name implies, is a type of networking technology that connects de...
A: Your answer is given below in detail. Introduction :- Given : A local area network (LAN), as the n...
Q: Create a C program that accepts the inputs hours and minutes and calculates the total number of minu...
A: Code is given below :
Q: What is one of the motivations for using a shell other than bash instead?
A: Introduction: A Shell provides a user interface for interacting with the system and running commands...
Q: Use the pumping lemma to show that the following languages are not context-free. (a) {0 | n is a non...
A: Pumping lemma: If L is a context-free language, there is a pumping length p such that any string w ∈...
Q: 12. Perform the given calculations in base-five notation. Assume that the numerals are already writt...
A: Base 5 notation numbers contains number from 0 to 4.
Q: (c) Convert the following denary numbers to 8 bit binary numbers and evaluate using the '2's' comple...
A: I'm providing the answer to above question. I hope this will be helpful for you....
Q: Explain the conditions that lead to a system becoming stuck in a deadlock.
A: Introduction: The following circumstances cause a system deadlock: - Circular Wait Condition Hold an...
Q: Exercise 4.39: Write a program that uses loops to generate an n x n multiplication table for positiv...
A: Use center for row number and remaining all numbers will be with right justification with size 3
Q: Write short notes on the access pointer and their manipulators. (C++)
A: Answer the above questions are as follows:
Q: What impact is the rising use of smartphones and tablets, with their smaller screen sizes, having on...
A: INTRODUCTION: USER INTERFACE: A device's user interface (UI) is the interface between the user and t...
Q: Problem 1: The Mysterious Function We have come through an old interesting function whose pseudo-cod...
A: A- If N<250 Then output is same for all N. def MYSTERIOUS_FUNCTION(n): if n>250: ret...
Q: In a bag of biscuits, there are 22 biscuits per bag, and a container holds 70 bags of biscuits. Crea...
A: Here is the explaination of the program and the easy approach :- First create all the variables re...
Q: What are the most significant factors to consider while designing a physical database?
A: Introduction: This topic focuses on the most critical factors to consider while creating a physical ...
Q: What Is SDLC?
A: SDLC stands for Software Development Life Cycle. It is also called as Software Development Process. ...
Q: What consequences would there be if cryptographic technology were not used?
A: Introduction: The work of the Cryptographic Technology (CT) Group in cryptographic mechanisms includ...
Q: The International Monetary Fund (IMF) produced a report in 2017 stating that crime appears to be inc...
A: Solution 1) Quantum computing Quantum computing will make current day encryption practice...
Q: (a) Write a computer program to find the LU decomposition for the matrix A: [1 2 2] 1 su11 И12 U13 1...
A: Solution: Let, A be a square matrix. An LU factorization refers to the factorization of A, with prop...
Q: Disadvantages of not having information technology/information systems in your company
A: Information Technology/Information System: Information technology is critical to the success of eve...
Q: Consider an array of N integers. Describe an algorithm with an 0(N) runtime that processes the array...
A: Please refer below for your reference: Below is a O(n) approach: I have counted the number of null a...
Q: 9n³ – 3n? + 12 is O(n³) O True O False
A: We are going to check whether given recurrence is in O(n3) or not.
Q: Create a software that accepts 10 digits from the user and displays the number that is the smallest ...
A: Note: The needed software is written in the C++ programming language.
Q: nt devices and infrast
A: In a local area network, how would you link endpoint and infrastructure devices? To make the connect...
Q: Write an abstract class, it can be anything well defined from the very basics.
A:
Q: Make a distinction between the Operating System and the System Programs. Provide examples and then e...
A: The solution to the given problem is below.
Q: ID Major Avg. project score Avg. exam score Employed? Salary Computer 82 76 Yes 90,000 Engineering 8...
A: a. Data Cleaning: Step 1: Remove irrelevant dataStep 2: Deduplicate your dataStep 3: Fix structural ...
Q: Please code in python a.) Suppose that x and y are variable names that already refer to Boolean val...
A: - We have to write expressions in python for the evaluation of conditions.
Q: Single form could be saved as an executable extension with: O EXE None of the above Frm VRD
A: FRM is file extension is contains structure data of a table of MYSQL data base
Q: Describe a CSS element that would repeat an image in the background along both the X and Y axis
A: NOTE :- Below i explain the answer in my own words by which you understand it well. repeat-x: Re...
Q: In order for a TryParse method to work,
A: we have three choices : Parse, Convert, and TryParse. My idea is use which have three choices : Par...
Q: What exactly is Archive? Also, can you describe how it works, the different types, the benefits, and...
A: Archive: An archives is a place where people can go to gather firsthand facts, data, and evidence fr...
Q: What exactly are Web pages?
A: Web pages are hypertext document(collection of text, image, audio, video etc.) that is suitable for ...
Q: flowchart of arithmetic sequence formula
A: The answer is given below step
Q: Processes in data flow diagrams are often coded. Which of the following statements concerning coding...
A: Let's see the solution in the next steps
Q: What is open source in computer science?
A: They are two types of software one is open source another is closed source
Q: Creating a program that computes the rent in five years and the total rent for one year starting fiv...
A: I give the code in C++ along with output and code screenshot
Q: What metrics are utilised for software maintenance?
A: Introduction: In software maintenance, there are five categories of metrics.
Q: Consider the following function for 2-vector x = (x,x)“. Bold letter indicates vector f(x) = f(x ,.x...
A: We need to create the two vectors x1 ,x2 ,then compute the f(x) , f_hat(x) ,plot it and compute the ...
Q: Explain the meaning of the phrase "Verification model satisfies the specification" in the context of...
A: Introduction: The question requires you to define the phrase "Verification model fulfils the specifi...
Q: 1 bit is equal to * O 6 byte 10 patterns O 8 bytes All choices are incorrect O 2 patterns The CPU pr...
A: The solution to the given problem is below. ***Note: According to Bartleby policy we are not all...
Q: between a
A: given - What is the difference between a member of a protected class and a member of a private class...
Step by step
Solved in 4 steps with 2 images
- Solve in java Double variable numInches is read from input. Type cast numInches to an integer. Ex: If the input is 62.5, then the output is: 62Write the Java program to prompt the user for a positive integer n greater than 1 (No error check is required), The program then should print the sum of all the factors* of the integer n. (Only while loops are allowed in this problem). *Factors of an integer n are the positive integers which can divide n without leaving a remainder. For example: if n = 30, the factors of n are 1, 2, 3, 5, 6, 10, 15 and 30. And the sum of them is: 1 + 2 + 3 + 5 + 6 + 10 + 15 + 30 = 72.Use Java Implement a game of Pig where the user plays against a "hold at 20 or goal" computer player that rolls until a 1 ("pig") is rolled, or the turn total is greater than or equal to 20, or the score plus the turn total is greater than or equal to 100. The first player is chosen randomly. An empty input (i.e., Enter) indicates that the user wishes to roll. Any entered line of non-zero length indicates that the user wishes to hold. Before the game, randomly select which player the user will be, and print the line "You will be player #.", where # is the user's player number. Then, print an instruction line "Enter nothing to roll; enter anything to hold." Before each turn, print a line with "Player 1 score: " and player 1's score. Print another line with "Player 2 score: " and player 2's score. Finally, print a line with "It is player #'s turn.", where "#" is replaced by the current player number. Play starts with player 1 and then alternates. For each roll, print a line with…
- Write in Java: Write a program that takes in a positive integer as input, and outputs a string of 1's and 0's representing the integer in binary. For an integer x, the algorithm is: As long as x is greater than 0 Output x % 2 (remainder is either 0 or 1) x = x / 2 Note: The above algorithm outputs the 0's and 1's in reverse order. You will need to write a second function to reverse the string. Ex: If the input is: 6 the output is: 110 Your program must define and call the following two methods. The method integerToReverseBinary() should return a string of 1's and 0's representing the integer in binary (in reverse). The method reverseString() should return a string representing the input string in reverse. public static String integerToReverseBinary(int integerValue)public static String reverseString(String inputString) LabProgram.java: import java.util.Scanner; public class LabProgram {/* Define your method here */ public static void main(String[] args) {/* Type your code…Given L = {w = {a, b}*: |w| is even}, the correct statements are: (aa U ab Uba U bb)* is a regular expression that generates L. (ab Uba)* is a regular expression that generates L. aa U ab U ba U bb is a regular expression that generates L. ab U ba is a regular expression that generates L.Write a Java program that asks a user to enter his/her age. If the user's age is in the range of [18, 150] (18 ≤ age ≤ 150), program prints “Old enough!”, when the given age is smaller than the given range it must print “Too young”, and otherwise prints "Incorrect age."
- Prompt the user for an integer, determine if it’s even or odd. Make a cod in Java that results like test case examples.Modify the provided PrintQs.java program. The program currently asks the user to enter an integer (call it thenumber N). Modify the program so that it will draw an NxN grid of Q's. For example, if you enter 7, the programwill print to the screenQQQQQQQ QQQQQQQ QQQQQQQ QQQQQQQ QQQQQQQ QQQQQQQ QQQQQQQ There are 7 lines printed and each line has 7 Q's printed (without spaces). Use nested for loops and only print asingle Q at a time. This example will call System.out.print('Q') 49 times and System.out.print() 7 times.Running the program with the value 2 will printQQ QQCorrect answer will be upvoted else downvoted. number is called 2050-number if it is 2050, 20500, ..., (2050⋅10k for integer k≥0). Given a number n, you are asked to represent n as the sum of some (not necessarily distinct) 2050-numbers. Compute the minimum number of 2050-numbers required for that. Input The first line contains a single integer T (1≤T≤1000) denoting the number of test cases. The only line of each test case contains a single integer n (1≤n≤1018) denoting the number to be represented. Output For each test case, output the minimum number of 2050-numbers in one line. If n cannot be represented as the sum of 2050-numbers, output −1 instead.
- Write a program that reads (n) from numbers and calculates the sum of positive numbers only.Write a program that reads two matrices of integers. It then generates the sum, difference and productof the two matrices.The sum of the two matrices of the same size is a matrix with elements that are the sums of thecorresponding elements of the two given matrices. Addition is not defined for matrices of different sizes.If A and B are matrices of the same size, then we define subtraction as follows: A – B = A + (-B). Thus, tosubtract matrix B from matrix A, we simply subtract corresponding elements.To multiply a matrix by another matrix we need to do the "dot product" of rows and columns. The "DotProduct" is where we multiply matching members, then sum up:(1, 2, 3) • (7, 9, 11) = 1×7 + 2×9 + 3×11 = 58We match the 1st members (1 and 7), multiply them, likewise for the 2nd members (2 and 9) and the3rd members (3 and 11), and finally sum them up.Write a program that reads two matrices of integers. It then generates the sum, difference and productof the two matrices.The sum of the two matrices of the same size is a matrix with elements that are the sums of thecorresponding elements of the two given matrices. Addition is not defined for matrices of different sizes.If A and B are matrices of the same size, then we define subtraction as follows: A – B = A + (-B). Thus, tosubtract matrix B from matrix A, we simply subtract corresponding elements.To multiply a matrix by another matrix we need to do the "dot product" of rows and columns. The "DotProduct" is where we multiply matching members, then sum up:(1, 2, 3) • (7, 9, 11) = 1×7 + 2×9 + 3×11 = 58We match the 1st members (1 and 7), multiply them, likewise for the 2nd members (2 and 9) and the3rd members (3 and 11), and finally sum them up.Use the following definitions:#define ROW 6#define COL 6void add (int matrixResult[] [COL], int matrixA[] [COL], int matrixB[][COL],int row, int…