Which of the following will lead to a compile-time error? Mark all that apply. if (a > b) c = 0 else b = 0; if (a > b) ( c = 0; ) if a > b{ c = 0; } if a > b, then c = 0; if (a > b) { c = 0; } if (a > b) c = 0;
Q: 04 what is the result of following if: a=3, b=3? i- ab iv- a>=b V- a==b vi- a!=b
A: Implementing the above statements through C++ langauge. #include <iostream>using namespace…
Q: Display the results in Part B using appropriate dialog box as shown. Administrator: Command…
A: Answer
Q: Assuming the code x = (2* (3 – (4 * (9 + 8 * 6 /10) % 4) + 7) / 9); has been executed correctly,…
A: () Parentheses has the highest priority. Then *, /, % have the priority and associativity from left…
Q: iterate func s 0 = s iterate func s n = func (iterate func s (n-1)) What is the output of the…
A: see first x is changed to 2x then rest of the things are done
Q: Given the following: Group A (Tom 40, Dave 67) Group B (Jade 30, Molly 25) Group C (Max 50, Comfort…
A: Algorithm : Step 1 : declare variables. Step 2 : assign the marks of each student in each variable.…
Q: Assume Cylinder is a subtype of Circle. Analyze the following code: Cylinder cy = new Cylinder(1,…
A: Analyzed the given code
Q: Exercise 3. Parameter Passing What are the values of y and z at the end of the following block under…
A: Here is the explanation regarding the code:
Q: rin series are a type of Mathematic series expansion in which all terms are nonnegative real powers…
A: the code is an given below :
Q: Create a complete Java program that will determine the CGPA for the grade entered by user based on…
A:
Q: In a piece of paper, write a Verilog code using procedural constructs such as blocking and…
A:
Q: Use Python for this question: Craps is a single player dice game, that proceeds as follows:…
A: The python program is given by import random #function to calculate the sum of 2 dies def…
Q: What is the scope of identifier x which is declared in Line 4? Consider the following program: const…
A: Scope of the variable: Local variable: Variables declared inside the function or block are called…
Q: A company wants to secure users' passwords that consists of four digits only by encrytping them.…
A: The programming methodology for the program is given by: Including header files Function prototype…
Q: Develop a Java web service that supports method “double add(double x, double y)” for returning the…
A: As per the instructions provided If the posted question contains more than one questions we are…
Q: When you use a mortgage to purchase a home, the lending institution effectively owns the home. You…
A: Answer :
Q: We need to do this same project in Excel VBA but with as many functions instead of subroutines.…
A: Write a program for a calculator using excel VBA.
Q: Let's modify the program from this section so that the user can supply the interest rate. For very…
A: Step 1: Declare a constant to store initial balance. Step 2: Declare and initialize year to be 0.…
Q: By default, which one of the following types of values will be thrown when the below function is…
A: The problem is based on the basics of functions in python programming language.
Q: Every cell (x,y) contains an integer ax,y signifying the course of how the ball will move. ax,y=1 —…
A: Here have to determine about Jeopardy of Dropped Balls code for given problem.
Q: Suppose a bank offers annual interest of 3% on balances of less than $5,000, 3.25% on balances of…
A: I have provided a Matlab code for the count the new balance in step 2.
Q: convert the follwing c++ program into pep/9 assembly language and show the screen shot of pep/9 code…
A: MNEMONICS USED: ADDSP: Add to stack pointer (SP). Memory allocated for local variables at run-time.…
Q: If you forget to declare the variable i in the following, what kind error will be raised? c++ while…
A: Variable are the name Which stores values.
Q: Suppose ?? denotes the amount in the account after ? years. Use an iterative approach to find a…
A: Note: The amount and formula are not clear in the question so the compound interest program in…
Q: What is the output of the following code when embedded in a complete C++ int secret (int x) { } int…
A: #include <iostream>using namespace std;int secret(int x) // function prototype{ int i=2*x,…
Q: Now suppose we run the program at a debugging mode and when the execusion arrived to the breakpoint,…
A: Answer: The line commented with A
Q: Create a complete Java program that will determine the CGPA for the grade entered by user based on…
A: The program mentioned above is super easy to create using java Here is how :- Create the string…
Q: What is the output of the following code snippet? new Student(); = new Student(345, 3.5); Student…
A: 1. B. 0 3.5 2. D 345 345
Q: What is the runtime analysis (expressed using Big-O notation) of the following code snippet?…
A: The above question is solved in step 2 :-
Q: What is the scope of identifier x which is declared in Line 10? * Consider the following program:…
A: Given: To choose the correct option.
Q: def aaa(p): return p ** 3 print("more defs". def bbb(q): return q // 16 def ccc(p, q): print(aaa(p))…
A: I have given justication of this code below in detail.
Q: SeaMoney has a feature to transfer money between users. Let's imagine a simple scenario. N…
A: Using hashmap to store the username as key and balance as associated value with the key. Below is…
Q: Consider the following declarations. In each case, write the English name of the type of x. Example:…
A: (a) int *x[];(b) int (*x)[];(c) double **x;(d) unsigned long int (*x[])[n]; Given the declarations.
Q: In c void f (int *p, int * const q) { p=q *p=3; *p=4; }
A: The pointer in C language is a variable which stores the address of another variable.
Q: Consider the code presented below. What is/are the line(s) that will never be executed, for any…
A:
Q: Please USE PYTHON Implement the design of the Pasta class so that the following output is…
A: 1) Below is python program to implement the design of the Pasta class so that the following output…
Q: Write a program in java that determines the value, true or false, of the following logical…
A: Given : Here cont variable and limite variables data type and values are given also here some…
Q: 2. Fibonacci sequence is series of numerical terms where each term depends on two previous terms…
A: Solution: Given,
Q: I am running a hotdog eating contest parameters are; 10 hotdogs to the pack 8 buns to the pack…
A: Problem 1 : Source code : # reads a number from the usern = int(input()) # if number is less than 0…
Q: In the following code stream, identify if there are any hazards. Crisply describe if it is possible…
A: About hazards: Structural hazards: it means that hardware cannot support the combination of…
Q: Let p: 2 + 1 = 3; q: 16 − 9 = 7. (a) ~p ∨ q TrueFalse (b) ~p ∧ ~q TrueFalse (c)…
A: Here in this question we have given some statement with variable p and q..and we have asked to find…
Q: A programmer notices the following two procedures in a library. The procedures do similar, but not…
A: Given Procedure MaxTwo (x, y) returns the greater of its two integer parameters. Procedure MaxThree…
Q: ompile time B. early / less expensive error checking C. strong typing does not allow type…
A: Explanation: Static typing helps to work with relational databases and other systems that use…
Q: main.cpp:4:17: error: string' has not been declared 4 | void KMPSearch(string pat, string txt)…
A: Hi there, Please find your solution below, I hope you would find my solution useful and helpful.…
Q: True or False? In VBA, it is possible to have have nested "If-Then-End If" blocks
A: Decision making statement allows to decide the order of execution of specific statements in the…
Q: Write a program for a calculator. Write the following sub getOption, getNumbers, printResult,…
A:
Q: What is the scope of identifier Sum which is declared in Line 6? * Consider the following program:…
A: D) Line 6 to Line 9
Q: Consider the following source code : c = a + b d = c c = c – e a = d – e b = b * e b = d/b…
A: Given source code is c = a + b d = c c = c – e a = d – e b = b * e b = d/b
Q: Assuming the code x = 3 % 4 - 2 * 5 / 6 * (3 * 2 – 1); has been executed correctly, what is the…
A: Introduction: Here we are asked what will be the value of x which have a equation given above.
Q: Please analyze the run time of the following two programs in terms of the tightest Big O.
A: outer for loop runs for constant 100 iterations, j=0 to 100 Inner for loop runs for n iterations,…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- In Java - A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400; therefore, both 1700 and 1800 are not leap years Some example leap years are 1600, 1712, and 2016. Write a program that takes in a year and determines whether that year is a leap year. Default code: import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int inputYear; boolean isLeapYear; isLeapYear = false; inputYear = scnr.nextInt(); /* Type your code here. */ }}The solution is available on chegg and other sites but its working so I need the proper solution for this one. Please provide explain in detail. Question 30: Develop a Java web service that supports method “double add(double x, double y)” for returning the summation of two floating point numbers; and develop a Java client program to consume this web service. To convert string “12.5” into floating-point number 12.5, you could use “double d = Double.parseDouble(“12.5”);”. Question 31: Develop a Java web service client application that consumes the web service that you developed in Question 30.I have to write a JAVA program that'll solve the following problem. What 13 digits give the highest product and what Is said product?? I tried to run the code in Online GDB compiler and got the following 2 last screenshot. This is my code so far and I wish to know if it is correct.... import java.util.Scanner;public class Main{public static void main(String[] args){Scanner sc = new Scanner(System.in);int[] array = new int[1000];for (int i = 0; i < 1000; i++){array[i] = sc.nextInt();}long p = 1;for (int i = 0; i < 13; i++){p = p * array[i];}long ma=p;for (int i = 13; i < 1000; i++){ if(array[i-13]!=0) { long np = (p/array[i-13])*array[i];if(np>ma){ma=np;}p=np; } }System.out.println(ma);}}
- Write a program IN JAVA for an instructor whose course has the following policies: Two quizzes, each graded on the basis of 10 points, are given. One midterm exam and one final exam, each graded on the basis of 100 points, are given. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent, and the two quizzes together count for a total of 25 percent. (Do not forget to normalize the quiz scores. They should be converted to percentages before they are averaged in.) Any grade of 90 percent or more is an A, any grade between 80 and 89 percent is a B, any grade between 70 and 79 percent is a C, any grade between 60 and 69 percent is a D, and grade below 60 percent is an F. The program should read in the student’s scores and display the student’s record, which consists of two quizzes scores, two exams scores, the student’s total score for the entire course, and the final letter grade. The total score is a number in the range to 100, which represents the…Maclaurin series are a type of Mathematic series expansion in which all terms are nonnegative real powers of the variable. The Maclaurin series expansion for ???(?) is given by the following formulathat is valid for all real values of x such that x is in radians (Note that: ???????(?) = ? × ?/180): Implement a Java program to compute the value of Maclaurin series expansion for sin(x) where x is a nonnegative real value according to the following: Write a java method named Factorial that takes as an argument an integer value ? and returns the mathematical factorial ?! of ? as a long value such that: n! = n * (n-1) * (n-2) * ........*2 *1 Sample run:Enter an angle in degrees: 30Enter number of terms of maclaurin series: 5Sum of first 5 terms of Maclaurin sries of sin(30) is 0.500000.Math.sin(5) is 0.500000Math.sin(30) - Maclaurin series = 0.000000Rock-paper-scissors is a game for two players. Each player chooses an action without knowledge ofthe other’s choice. If the players choose the same action then there is a draw. Otherwise the winneris determined by the following rules: paper beats rock, rock beats scissors, and scissors beats paper. you are going to make a playable Rock-Paper-Scissors game and consider multiplayer tournaments. • Please make it a single Haskell file • Please put comments in your code to show which question you are answering with each piece ofcode. • You may create auxiliary functions if you like. You may use library functions from Haskell’sstandard library.• Please limit your line lengths to 100 characters max.Please use the following two data types which you can copy-and-paste into your code.data Action = Rock | Paper | Scissors deriving (Eq, Show)data Outcome = Player1Win | Player2Win | Draw deriving ShowAction represents a player’s chosen action and Outcome represents the outcome of playing a game
- Write a Java code to implement the main functions of a simple perceptron. The target perceptron has three inputs, one output. Instances Sensor 1 Sensor 2 Sensor 3 Alarm Instance 1 Off Off On Fake Instance 2 On On On Real Instance 3 On Off On Real Instance 4 Off On On Fake This perceptron is used to analyze data from sensor inputs and, based on the analysis, it classifies alarms as true or fake. The table above shows four instances from the alarm box records and their alarm true class. These four instances will be used as a dataset to train the perceptron. After training the perceptron, it will be used to predict the alarm class for an unseen instance. Write the Java code for the following two public classes: Forward_Propagation: This class implements the forward propagation flow. The class does the following Defines the inputs and outputs as double arrays in the code double[][] inputs = new double[][]{ {0, 0, 1},…write a c program Count Dracula buys blood from the public. But since he prefers certain types to others, he pays as follows: Type Rate/liter A P 3000.00 B P 1800.75 C (for AB) P 2880.25 O P 1500.00 Write a C program to input a client’s blood type and the volume (liter) of blood extracted. Output how much the client will be paid.Change Java code below so that it outputs a 9x9 board and not a 3x3 board. import java.util.*; public class Tic_Tac_Toe{ static String[] board;static String turn;static String checkWinner(){for (int a = 0; a < 8; a++) {String line = null; switch (a) {case 0:line = board[0] + board[1] + board[2];break;case 1:line = board[3] + board[4] + board[5];break;case 2:line = board[6] + board[7] + board[8];break;case 3:line = board[0] + board[3] + board[6];break;case 4:line = board[1] + board[4] + board[7];break;case 5:line = board[2] + board[5] + board[8];break;case 6:line = board[0] + board[4] + board[8];break;case 7:line = board[2] + board[4] + board[6];break;}//For X winnerif (line.equals("XXX")) {return "X";} // For O winnerelse if (line.equals("OOO")) {return "O";}} for (int a = 0; a < 9; a++) {if (Arrays.asList(board).contains(String.valueOf(a + 1))) {break;}else if (a == 8) {return "draw";}} // To enter the X Or O at the exact place on board.System.out.println(turn + "'s turn; enter…
- You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad. Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad. given is an API bool isBadVersion(version) which returns whether version is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API. please write code in pythonTHIS IS IN JAVA Which value of x results in short circuit evaluation, causing y < 4 to not be evaluated? <pre><code>(x >= 7) && (y < 4)</code></pre> A. 6 B. 7 C. 8 D. No Such ValueIn Java you are going to create a program that will output the number of possible passwords given the constraints below and you will output one randomly generated password given the constraints. Consider the following definitions for sets of characters: Digits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }Letters = { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z }Special characters = { *, &, $, # }The constraints for this project: Strings of length 8. Characters can be special characters, digits, or letters. The first character must be a number. 1. Compute the number of passwords that satisfy the given constraints. 2. Randomly generate a password given the above constraints. This program should output a different password every time because it is being randomly generated.