a) 1357 b) 2 4 6 8 c) 1 3579 d) 123 4 5 6 7 89
Q: 1 b. 3.
A: Adjacency Matrix a b c d a 0 1 2 5 b 0 0 3 0 c 0 0 0 1 d 0 0 0 0
Q: 1) 8*3.0 + 17/3 2) 11%3 +1/5+ 0.5*4 3) !(200.2
A: As per guidelines we can answer only Three subparts for answer of other parts ask separately
Q: 10 8- 6. 0.0 0.5 1.0 1.5 2.0 2.5 3.0
A: matplotlib code for
Q: a) [15 26 3] b) [ 5 3 4 2 1] c) [1 53 4] d) [ 4 5 1 3 2]
A: p-box: A permutation box (or P-box) is a bit-shuffling method used in cryptography to permute or…
Q: 1 43 1112 41 42 32 Example Output 4 3 2
A: Below is the Code in C++
Q: (c) Differentiate (1+x 1
A: Here in this question we have asked to solve the derivation.
Q: A B E
A:
Q: Do the following operation (i) (376 )8 + (521)8 (ii) (224 )8 + (631)8 (iii) (704 )8 - (203)8
A: The first three parts will be answered. Use the following table to perform octal addition: + 0 1…
Q: 1. b // 5 > a 2. b% 2 >= a 3. a + b + c 4. (a * 20 == b) and c
A: answer to 1 , 2 and 3 is given from python code in step 2.
Q: 8 (56 − 255 − s4 + 2s³ + 4s²-85-4) les are located in the right half-plane, in the left half-plane,
A: Base on root locus we can tell
Q: 15 b 21 14 c 17 d 00 2. 1.
A: Initialize distances from the source to all vertices as infinite and distance to the source itself…
Q: 1 → *A A *B C
A: Given I, I • [-; A H C C Informally describe the language accepted by this DFA, and prove by…
Q: (a) (b) 3 1 2. 4. 6 7. 6.
A: Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree…
Q: g. 42 % 36 6 + 36 / 7 * 4 h. 5 / 9 * (32.6 - 4.5) i. 13.5 + 2.0 * 4.0 / 4.0
A: Please find the answer below :
Q: AB+ (B+C)(A+B)
A: AB+(B+C)(A+B) AB+(B+C)(B+A) AB+B+CA (A+1)B+CA 1.B+CA B+CA
Q: 8l apn A D G C E
A: G -> B -> C-> F -> E be the shortest path
Q: a) (239.174)10 = ( )2 %3D
A: Since you have asked multiple questions in a single request, as per policy, only the first question…
Q: 94.36)10 to ( )Ex-5
A: 110101.11 0011 0101. 1100 0011 0110.0010 3 6.2 100100.00110011001100110011
Q: i. (435)8 = ( ? )16 ii. (8D1)16 = ( ? )8 %3D
A: i. (435)8=(?)16 Step 1: (435)8=(?)2 binary representation of 4 -> 100 binary representation of 3…
Q: S 040 | 1B1 | BB C S | A A B C
A: We are given Context Free grammar and we are asked to convert it into an equivalent Chomsky Normal…
Q: A 0 0,1 0,1 C 1 B
A: Hey there, I hope you find my solution helpful.
Q: [0] 51 [1] e [2] 91 [3] 8 [4] 96 [5] 11 [6] 74 [7] 27 [8] 80 [9] 20 The minimum value : 0 The…
A: Code: import java.util.Scanner; public class StatsArray { // filling the array with random…
Q: b) 10 20 + 25 15 - * 30/ c) 5 7 3 + * 8 4 /-
A: For evaluating postfix operation, Push operands onto stack . When operator is encountered, pop top…
Q: a b 1 2 a a 3 a b. b a b 4
A: The Answer is in Below Steps
Q: 3 a
A: Answer is given below.
Q: 7. (37+45) mod 12 9. (196) mod 5 8. (62 21) mod 2 10. (2510) mod 4
A: “Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: 15 5. Multiply 3-5 6 0. 15 A. 18 15 0. -3 15 B. -15 18 3 -15 C. -15 18 3 15 D. -15 18 0
A: Multiply 315-5600 Matrix multiplication is done by multiply that number with every element of…
Q: 25 + 4 - 7 b. 8 / 3 C. 13 / 3 * 6 - 10 а.
A: As per guidelines, we are supposed to answer only three subpart of a question. Kindly repost other…
Q: 2 * 7 1 5 6 4 8 3
A:
Q: [0 4 91 8 3 3 81 A = 4 Find B- 5A. -7 -17 -371 A. B- 5A = 9 -26 -39 7 11 B. B- 5A = 39 -11 17 -37 26…
A: Find out 5A by multiplying 5 to every element of A then subtract B
Q: اكتب برنامج C++ لإدخال قيمتين من نوع العدد الصحيح ثم قم بتبديل أحدهما واستبدال الأخر )على سبيل…
A: Required: Write a C++ program to enter 2 numbers and swap their values. Required code with…
Q: 1 2 a a 3 4
A: 1 if starting state is accepting state oe ahs transition in it then add E(null) moves to the state 2…
Q: b. Σ w.
A: The answer is
Q: A BC X(A,B.
A: a.
Q: A 1 2 3 6. 7 three 8. 7 Rectand 10 11 =B6+B7+B8
A: Answer : The given MCQ Answer is option C ) !#VALUE.c it gives the error #value error because it has…
Q: 8 15 14 11 H 16 E 7 5 9. 10 13 12 3 I
A: in prims algorithm if number of vertex are n then edges will be n-1 here number of vertex are 6 so…
Q: L[3.1] + [-2.6] +1.9] O 2 O 1
A: Given [3.1]+[-2.6]+[1.9]
Q: =! .a != .b ==.C
A: The operator is used to compare two elements in matlab is ==
Q: ᴜꜱɪɴɢ ᴍᴀᴛʟᴀʙ ꜰɪɴᴅ ᴛʜᴇ ꜱᴜᴍ 1.5+3+5+7.5+10 ᴜꜱɪɴɢ ᴛʜᴇ ꜱᴜᴍ ꜰᴜɴᴄᴛɪᴏɴ ᴀɴᴅ ᴛʜᴇ ᴄᴏʟᴏɴ ᴏᴘᴇʀᴀᴛᴏʀ. ᴀɴᴅ ɢɪᴠᴇ ᴍᴇ…
A: logic:- define a column vector with elements as 1.5 , 3, 5, 7.5 , 10 . Separate it using ;…
Q: (a) Perform the following operations: ) (5BD.EC)16 = ( ? )½ (i) (11011.11)2-(1101.011)2
A: Binary Number: The number system which has a base- 2 is called binary number system. It has only 2…
Q: 2 3 4 55 6 6 6 7 6 6 7 2 3.
A:
Q: ᴄʀᴇᴀᴛᴇ ᴛʜɪꜱ ᴡɪᴛʜ ᴍᴀᴛʟᴀʙ ᴏɴʟʏ ᴜꜱɪɴɢ ᴛʜᴇ ᴄᴏʟᴏɴ ᴏᴘᴇʀᴀᴛᴏʀ ᴀɴᴅ ᴛʜᴇ ᴛʀᴀɴꜱᴘᴏꜱᴇ ᴏᴘᴇʀᴀᴛᴏʀ, ᴄʀᴇᴀᴛᴇ ᴀ ᴄᴏʟᴜᴍɴ…
A: transpose function will find the transpose of matrix altering rows and columns and as we are having…
Q: (b) 3 2.5 2 1.5 0.5 -0.5 1 Time (sec) (1)×
A: MATLAB program is a script, which contains a set of commands exactly as you would type them at…
Q: Computer Science T(n) = T(n-3) + n using chip and conquer method
A:
Q: A B C
A: Hey there, I am writing the required solution of the questin mentioned above. Please do find the…
Q: a(b + 8) = ab +
A: Given statement is a(b + 8)
Q: a. 224.45.57.93/24 b. 12.2.2.5/30
A: a) 224.45.57.93/24 in binary representation: 11100000.00101101.00111001.01011101 Network address is…
Q: 2 3 4 M en 5 6 7 8
A:
Q: B 5- 4 3 I I D
A: Given :
Q: ب أن يقوموا بكتابة برنامج بلغة + + CH .1,1,2,3,5.8.13.21 الي فهل البرنامج صحيح أم لا إذا كان
A: #include <iostream> using namespace std; int main() { int…
Step by step
Solved in 4 steps with 1 images
- 4.31 LAB: Months until payoff (JAVA) Write a program in java that reads a loan amount, payment amount, and interest rate as inputs and outputs the number of payments required until the loan is paid. Interest is added to current balance before a payment is applied. Ex: If current balance is $100.00 and the interest rate is 0.02, the new balance is $102.00 before a payment is applied. All values are doubles. import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); /* Type your code here. */ }}Problem Statement: The mathematician Conway imagined a game, called game of life, which considered cells that are susceptible to reproduce, disappear, or survive when they obey certain rules. These cells are represented by elements on a grid of squares, where a grid has an arbitrary size. Thus, each cell (except those on the boundaries of the grid) is surrounded by eight squares that contain other cells. The rules are stated as follows: 1. Survival: Each cell that has two or three adjacent cells survives until the next generation.2. Death: Each cell that has at least four adjacent cells disappears (or dies) by overpopulation. Also, each cell that has at most one adjacent cell dies by isolation.3. Birth: Each empty square (i.e., dead cell) that is adjacent to exactly three cells gives birthto a new cell for the next generation.It is worth noting that all births and deaths occur at the same time during a generation. Write a program that simulates this game and displays all successive…In C++ class rectangleType { public: void setLengthWidth(double x, double y); //Sets the length = x; width = y; void print() const; //Output length and width double area(); //Calculate and return the area of the rectangle (length*width) double perimeter(); //Calculate and return the perimeter (length of outside boundary of the rectangle) private: double length; double width; }; Set the length of the rectangle to 24 and the width to 30.
- Java problem First-Player Advantage Pig is a folk jeopardy dice game with simple rules: Two players race to reach 100 points. Each turn, a player repeatedly rolls a die until either a 1 ("pig") is rolled or the player holds and scores the sum of the rolls (i.e. the turn total). At any time during a player's turn, the player is faced with two decisions: roll - If the player rolls a 1: the player scores nothing and it becomes the opponent's turn. 2 - 6: the number is added to the player's turn total and the player's turn continues. hold - The turn total is added to the player's score and it becomes the opponent's turn. Problem: There is an advantage to going first in Pig, but how big an advantage is it for “hold at 20 or goal” play? We wish to estimate the probability of a first-player win with a hold-at-20-or-goal play policy. Simulate a given number of two-player Pig games where a player rolls until a 1 ("pig") is rolled, or the turn total is greater than or equal to 20, or the…In C++ class rectangleType { public: void setLengthWidth(double x, double y); //Sets the length = x; width = y; void print() const; //Output length and width double area(); //Calculate and return the area of the rectangle (length*width) double perimeter(); //Calculate and return the perimeter (length of outside boundary of the rectangle) private: double length; double width; }; Print out the area of the rectangle.In C++ QUESTION 14 class rectangleType { public: void setLengthWidth(double x, double y); //Sets the length = x; width = y; void print() const; //Output length and width double area(); //Calculate and return the area of the rectangle (length*width) double perimeter(); //Calculate and return the perimeter (length of outside boundary of the rectangle) private: double length; double width; }; Write the function definition for the function perimeter
- In C++ class rectangleType { public: void setLengthWidth(double x, double y); //Sets the length = x; width = y; void print() const; //Output length and width double area(); //Calculate and return the area of the rectangle (length*width) double perimeter(); //Calculate and return the perimeter (length of outside boundary of the rectangle) private: double length; double width; }; Declare an instance of rectangleType.Please comment the two codes below. (//1)The first is writing numbers vertically and second is on pins (//2) class Main { public static void main(String[] args) { //example1(); example2(6); writeVertical(120); System.out.println(numPins(5)); } //Infintie Recursion public static void example1() { } //Recursion with base case public static void example2(int n) { if(n ==1) { return; } else { System.out.println(n); example2(n-1); } } //Makes the number vertical public static void writeVertical(int num) { if(num ==0) { return; } else { writeVertical(num/10); System.out.println(num%10); } } //2 public static int numPins (int rows) { if(rows == 0) { return rows; } return numPins(rows - 1)+ rows; } }Java - How do I output this statement as a horizontal statement with a newline? Everytime I use System.out.println, it makes the entire output vertical instead of horizontal. Program below. import java.util.Scanner; public class LabProgram { public static void main(String[] args) { int x; int y; Scanner scan = new Scanner(System.in); x = scan.nextInt(); y = scan.nextInt(); if(y >= x){ for(int i=x; i<=y; i = i + 5) { System.out.print(i+ " "); (The problem line) } } else{ System.out.print("Second integer can't be less than the first."); } }}
- Evaluating Postfix Expression The Postfix notation is used to represent algebraic expressions. The expressions written in postfix form are evaluated faster compared to infix notation as parenthesis are not required in postfix. We have discussed infix to postfix conversion in the class. Write a Java program that will input a valid postfix expression. The expression may accept a whole number or a real number. Every operand and operator should be separated by a space. Make sure to trap possible errors.Sample Output (Must be implement in GUI)Computer Science Title: Programming - Practical Test 1 - SET 3Learning Objective:Write simple Java programs using basic data types, operators and expressions.Write Java programs using control structures - Sequence Question:Prepare a program that can read the price (RM) of two books. Calculate and print the total price (RM) of the two books that includes 5% discount.. Based on the given problem, the student need to:i. Write the Java programii. Display the output[100% marks] Sample input and output:Input price of book 1 : 50.50Input price of book 2 : 90.90Total price : 141.4Discount : 7.07Net paymant : 134.33 help me please asap.// SuperMarket.java - This program creates a report that lists weekly hours worked // by employees of a supermarket. The report lists total hours for // each day of one week. // Input: Interactive // Output: Report. import java.util.Scanner; public class SuperMarket { public static void main(String args[]) { // Declare variables. final String HEAD1 = "WEEKLY HOURS WORKED"; final String DAY_FOOTER = " Day Total "; // Leading spaces are intentional. final String SENTINEL = "done"; // Named constant for sentinel value. double hoursWorked = 0; // Current record hours. String hoursWorkedString = ""; // String version of hours String dayOfWeek; // Current record day of week. double hoursTotal = 0; // Hours total for a day. String prevDay = ""; // Previous day of week. boolean done = false; // loop control Scanner input = new…