35 to 40.
Q: Analyze the code below: bscs = "The final exam in PROG 1" s1 = bscs [4:14] s2 = bscs [10:14] +…
A: In Your Code
Q: The table at the center of a star schema for a data warehouse is referred to as Central table…
A: Note: we are only allowed to solve one question in one post. I am solving the first on here. To get…
Q: Generally in a nested loop, the outer loop determines the number of lines. Select one a True b.…
A: This question comes from Programming Language which is a paper of computer science. Let's discuss it…
Q: The index of the first item in a list is 1. Select one: a. True b. False
A: B. False.
Q: regular expression for the language recognized by the following FSM a b b a a a,b b
A: Given: We are provided with Deterministic Finite state automata and we have to generate the…
Q: d. Assume that the data is transferred using a 4B5B bit synchronization and error detection code (4…
A: In telecommunication, 4B5B is a form of data communications line code. 4B5B maps groups of 4 bits of…
Q: ' Your computer has the following IPV4 address at dotted decimal form: 10.Α. Α. Α/Β
A: IPv4 dotted decimal form 10.214.214.214/11 At first convert the IPv4 address into binary format:…
Q: 4. Which of these code snippets is the most readable? A B ellipse (x, y, 15, 5); ellipse (x, y,…
A: Find your Answer Below A. The Space between the function name and parenthesis makes it difficult to…
Q: If anyone o'clock. a. calls / tell / will be b. called / telling / would be c. is calling / tells /…
A: According to the question
Q: The following code segment is intended to remove all duplicate elements in the list myList. The…
A: The given code segment will group the together occurring elements from the right (End of the list)…
Q: Analyze the code below: for i in range(1, 1): for j in range (1, 2): print( 3, end= 4
A: i represents the row and j represents number of #'s that has to be printed in each line # is printed…
Q: Which of the following binary trees are AVL trees? 3 2 8, 8. 1 2 6. 3 7. 9 (b) (c) O A Ос O A, B O…
A: The AVL trees are the binary trees that are denoted by the property of self -balancing and having…
Q: Please explain and give an example of handshaking in TCP protocol, connection setup, 3 way…
A: TCP stands for Transmission control, it is a Transport layer protocol which is a reliable and…
Q: You are a teaching assistant for an introductory computer concepts course at your local community…
A: Operating system:
Q: Change the following IPV4 addresses from binary notation to dotted-decimal notation. a. 10000001…
A: a. 10000001 00001011 00001011 11101111 10000001 = 129 00001011 = 11 00001011 = 11 11101111 = 239…
Q: Analyze the code below: dogs = ["KK", "Cyber", "Blake", “Pinky", "Taki", "Chubby"] a = len (dogs) b…
A: Correct Option => a. 2 For more understanding , I have provided PYTHON CODE along with…
Q: Construct a regex which accepts words over alphabet {0, 1} with an odd number of 1s.
A: INTRODUCTION: A regular expression, also known as a rational expression, is a string of letters…
Q: Use appropriate SFR to initialize all bits of port D with 0 Note: give your answer in hexadecimal…
A: Given: Describe appropriate SFR to initialize all bits of Port D with 0.
Q: Analyze the code below: bscs = "The final exam in PROG 1" s1 = bscs [4:14] s2 = bscs [10:14] +…
A: According to the information given:- We have to choose the correct option to satisfy the statement.
Q: If replace() method is used in the string, the actual value of the String will change. Select one:…
A: Given:
Q: Consider a floating point representation similar to the IEEE 754 standard, but using 13 bits in…
A: value for x in 2x is x=exponent-bias.
Q: Write a function called minimax that takes M, a matrix input argument and returns mmr, a row vector…
A: Solution I tried my best
Q: Let the page fault service time be 10 ms in a computer with average memory access time being 20 ns.…
A: #include struct node { int data; //Data of the node struct node *nextptr; //Address of the next node…
Q: Implement circular queue using C++ to perform the following a) Enqueue- b) Dequeue- c) Display-
A: C++ code :- #include <iostream>using namespace std; int cqueue[5];int front = -1, rear = -1,…
Q: Find the value of the postfix expression given below 8 00 Your answer: 16 16 20 3 2 7 6 Clear answer…
A: For any postfix expression do, If an operand is encountered then push it into the stack. If an…
Q: For Bayesian Network (a)Write an expression for the "joint probability distribution" as a "product…
A: The joint probability distribution can be expressed either in terms of a joint cumulative…
Q: Assume you are working in a system where the memory limit for a register is 4 bits. Assume that R1 =…
A: The ADC (Add with Carry) instruction which adds the values in Rn and Operand2 , together along with…
Q: Suppose we are given two sorted arrays A[1..n] and B[1..n]. Describe an algorithm to find the median…
A: If n is 1, return the average of both arrays' elements. If n is 2, return the average of the first…
Q: (4) 1. Let G = (V,T,S,P) be the phrase structure grammar with V={0,1,A,B,S}, T={0,1}, and the set of…
A: Given:- Set of productions:- S -> 0AB, S-> 1B, A -> 1B01, B -> 100
Q: 3. Write a Java program to sort a given array list. import java.util.*; public class Problem3 {…
A: Solution: (3) Java Code: To sort a given array list. import java.util.*; public class Main {…
Q: Which of the following is incorrect about DBMS? A table must have primary and foreign keys. The…
A: Refer to step 2 for the answer.
Q: The value of the length of the string and the value of the index of the last character are the same.…
A: This question comes from Programming Language which is a paper of computer science. Let's discuss it…
Q: The CPU cache potentially contains the next instruction for the process that is running. True False
A: CPU cache is a crucial component in modern computer architectures, designed to enhance the…
Q: Use the following C++ program code to answer questions 5-7 1 include ciostream 2 using nanespace…
A: To do: 6th question
Q: Apply Your Knowledge This section contains four mini-cases. Each case describes a situation,…
A: Given: Concept of supply chain management. SCM concept apply to the design of new systems. Why or…
--35 to 40.
Step by step
Solved in 4 steps
- Opengl Help Programming Language: c++ I need help setting coordinate boundries for this program so the shape can't leave the Opengl window. The shape needs to stay visiable.design patterns quetion public double calculatePerimeter(Shapes [] shapes) { double p = 0;for (Shape shape : shapes) { if (shape is Rectangle) { Rectangle rectangle = (Rectangle) shape; p += (rectangle.Width+rectangle.Height) * 2; } else { Circle circle = (Circle)shape; p += 2 * circle.Radius * Math.PI; } } return p; } which design principle is violated in the above code? what is the issue/ limitation of this code? rewrite the code to not violate the design principle you answered in part 1?17. Phone Book ArrayList Write a class named PhoneBookEntry that has fields for a person's name and phone number. The class should have a constructor and appropriate accessor and mutator methods. Then write a program that creates at least five PhoneBookEntry objects and stores them in an ArrayList. Use a loop to display the contents of each object in the ArrayList.
- Sultan Qaboos University Department of Computer Science COMP2202: Fundamentals of Object Oriented Programming Assignment # 2 (Due 5 November 2022 @23:59) The purpose of this assignment is to practice with java classes and objects, and arrays. Create a NetBeans/IntelliJ project named HW2_YourId to develop a java program as explained below. Important: Apply good programming practices: 1- Provide comments in your code. 2- Provide a program design 3- Use meaningful variables and constant names. 4- Include your name, university id and section number as a comment at the beginning of your code. 5- Submit to Moodle the compressed file of your entire project (HW1_YourId). 1. Introduction: In crowded cities, it's very crucial to provide enough parking spaces for vehicles. These are usually multistory buildings where each floor is divided into rows and columns. Drivers can park their cars in exchange for some fees. A single floor can be modeled as a two-dimensional array of rows and columns. A…Library class: Fields: books as arraylist to store all the books available in the library B3 B1 B2 В4 B5 Constructor: Library() } : No parameterized constructor to create the books object Methods: 1. addBook(Book bookobj): to add a new book to the arraylist; send the book object as a parameter to this method. 2. searchBook(String name): search a book by a given name in the arraylist. if exits print bookX found; otherwise print not found!!! 3. RemoveBook(String name): to delete a book object from arraylist by a given name: Hint: you need to use iterator class and remove method. Book class: Fileds: bookld, bookname. Constructor: two parameterized constructor that accepts name a parameter Book(int ID, String name) ..... Methods: 1. Accessor method to return the name of the book 2. Mutator method to change the id of the book. Use this Main method: in your program: public static void main(String args[]) { Library lib=new Library(); lib.addBook(new Book("b1")); lib.addBook(new Book("b2"));…Rest of code in image / This is a bad programming style since it is using goto. // This is an spagetti code and not working.// Use function to display menu, and display game rules,// Use different color for text display.// fix it so it works any way you like./*HANDLE screen = GetStdHandle(STD_OUTPUT_HANDLE); // Write 16 lines in 16 different colors. for (int color = 0; color < 16; color++) { SetConsoleTextAttribute (screen, color); cout << " Hello World!" << endl; Sleep(400); // Pause between lines to watch them appear } // Restore the normal text color) SetConsoleTextAttribute(screen, 7);*/#include <iostream>#include <windows.h>using namespace std;int main(){ //textbackground(WHITE); //textcolor(RED); system("cls"); char ch, a[20], ch2; int num = 100, rnum, guess, count, ch1, c = 0; cout << "**********************************************************"<<endl; cout << "*…
- Menu Item Description Add Dog 1) Asks the user for all the state value information for a dog. 2) Checks if there is space in the array to hold the new dog. 3) Check that the dogld is not already used in the system. 4) Creates a new Dog object and adds it to the array if there is space. If the array is full, print "Sorry... the Shelter is Full!". Note: All new dogs have no home as yet (foundHome = false). View all dogs This menu option shows all dogs in the system. This includes dogs that have a home and those that do not. View all available dogs Shows all dogs in the system, which have no homes as yet. View a specific dog 1) Asks the user for a dogld. 2) Searches for a dog at the shelter with that dogld. 3) Displays the information of the dog associated with that dogld if found. If the dog is not found, "There is no dog with that id.." must be displayed. Update dog home status 1) Asks the user for a dogld. 2) Searches for a dog at the shelter with that dogld 3) If a dog with that id is…class Main { // this function will return the number elements in the given range public static int getCountInRange(int[] array, int lower, int upper) { int count = 0; // to count the numbers // this loop will count the numbers in the range for (int i = 0; i < array.length; i++) { // if element is in the range if (array[i] >= lower && array[i] <= upper) count++; } return count; } public static void main(String[] args) { // array int array[] = {1,2,3,4,5,6,7,8,9,0}; // ower and upper range int lower = 1, upper = 9; // throwing an exception…int getUpperScore(){ int upperScore = 0; for(int i = ONES; i <= SIXES; i++){ upperScore += score[i]; } return upperScore + getBonusScore(); } //Returns the score of the upper part of the board int getLowerScore(){ int lowerScore = 0; for(int i = THREE_OF_KIND; i <= YAHTZEE; i++){ lowerScore += score[i]; } return lowerScore; } //Returns the bonus points int getBonusScore(){ const int UPPER_SCORES_THRESHOLD = 63; const int BONUS_POINTS = 35; if(getUpperScore() >= UPPER_SCORES_THRESHOLD){ return BONUS_POINTS; } return 0; } //Returns the total score int getTotalScore(){ return getUpperScore() + getLowerScore(); } Test 10: Check upper board and having bonus correctly (0/3) failed
- Path: p QUESTION 17 Display the value of the object pointed by cgPtr of type integer. T E E TTT Arial 3 (12pt) Path: p QUESTION 18 Declare and initialize array priceList with150.00, 235.00, 45.00, 23.75, 78.50. TTT Arial 3 (12pt) v T-E E- Path p Click Saue and SuhmitВ.width; } { t = B.type; w = { T.type = C.type; T.width = C.width; } T → B C В > int { B.type = integer; B.width 4; } В — foat { B.type = float; B.width = 8; } { C.type = t; C.width = w; } C - [ num] C1 = array(num. value, C1.type); { C.type C.width = num. value x C1. width; }10. Lottery Application Write a Lottery class that simulates a lottery. The class should have an array of five integers named lotteryNumbers. The constructor should use the Random class (from the Java API) to generate a random number in the range of 0 through 9 for each element in the array. The class should also have a method that accepts an array of five integers that represent a per- son's lottery picks. The method is to compare the corresponding elements in the two arrays and return the number of digits that match. For example, the following shows the lotteryNumbers array and the user's array with sample numbers stored in each. There are two matching digits (elements 2 and 4). lotteryNumbers array: User's array: 7 4 4 2 1 3 7 3 In addition, the class should have a method that returns a copy of the lotteryNumbers array. Demonstrate the class in a program that asks the user to enter five numbers. The program should display the number of digits that match the randomly generated…