please try to code them and send the output
Q: The value of BX after executing the following piece of code is : *
A: According to the question, we need to find the value of BX after executing the code: XOR AX, AX ADD…
Q: Which of the following is True about the following code
A: The correct answer is option 2: removing the PTR operator will cause an error because PTR is used to…
Q: please try to code them and send the output
A: Since the programming language is not mentioned I have coded this using Python 3.
Q: The code shown below is completely correct and has no errors
A: This code has errors. Variables a1 and a2 are not declared in the scope. So this code throw errors.
Q: Which of the following programs will NOT cause an error?
A: In Python, functions are declare using def keyword
Q: What's wrong with this code? i=31 whileți<=50): printți) A There is a problem with the…
A: The answer is given below:-
Q: - Show the printout of the following code:
A: bool b = true;int i = b; cout << b << endl;cout << i << endl;
Q: Evaluate the following postfix expression: 10 5 + 2 * 3 3 / %
A: 10 5 + 2 * 3 3 / % FINAL ANSWER IS 0 . Step 1 - Firstly Push the 10 and 5 into the stack . Step 2 -…
Q: What is printed by the following code segment?
A: The correct is ("cow?now?how?brown?") Option("D") Explanation If the break statement is located…
Q: Consider the following code fragment. What is the output for each of the Following input values for…
A: In the question, as we are provided with 5 inputs for 'n' so we have to tell the corresponding ouput…
Q: how to fix this error code
A: Required:
Q: please write a code for that
A: Since the programming language is not mentioned, I have coded above question Python. Follow the…
Q: What is the output of following code.
A: Given: Integer s= 4. Integer d=s++; Then d is printed as output. Solution: The priority of post…
Q: Fix all the errors in the following code by filling in the table below and display the output after…
A: Given: Required: find the error in the code
Q: Complete the code as below mentioned. Write all
A: Here, in this question, we are asked to develop a GO code. It is stated that the amount of potatoes…
Q: When does this code segment return true? a. When all int values in nums are greater than or equal to…
A: The given problem has a for loop segment that analysis the array elements. The requirement is to…
Q: What is the output of the following code:
A: There is an Compiler error because default arguments are the leftmost arguments. Correction in code…
Q: The following code will print Int x=10; Printf(“x=%d”,x++);
A: x++ means first we use the assigned value and then increment it after the use.
Q: 5. Rewrite the following code using a switch statement.
A: Approach Here, we are asked to replace if else-if with a switch statement. We will use the switch…
Q: What is the output of the following code
A: Required: programming
Q: What does this code print? Print (2**2**3*2)
A: ** represents exponent and has higher precedence than any other operator These exponents are nested…
Q: Find error in the code given below
A: Given code is C language code in which an integer variable n is declared and program is aimed to…
Q: What will be the output for a and b given the below code segment?
A: given: c++ code required: to run the code and provide output and value of a and b.
Q: Please fix this code:
A: where is your code please uploade the question in a write way you have not shareed the code
Q: Find the error in the following code
A: Please upvote. I am providing you the correct answer. You can never, in no context, change an…
Q: Identify and fix the errors in the following code:
A: The java.lang.Math.random() returns a double value with a positive sign greater than or equal to 0.0…
Q: What will be the output of given code.
A: In the given code a char variable ch is initialised with value 'A'. Then in output &ch is…
Q: is the output of the following code listing.
A: The method add(Element e) appends e to the end of the list. The method add(int index, Element e)…
Q: Rearrange the code, all necessary code is already listed
A: from _collections import defaultdictdef wiz_study_length(prereq_list,final = 'WIZ90001'):…
Q: What does the following code segment do? for i in range(5) : x.append(C[ ]) for j in range(3) :…
A: In the first line x=[] an empty list is created. Then in the next line, 5 empty lists are added to…
Q: What are the outputs of the following code?
A: Required: What are the outputs of the following code?
Q: What is the output when the following code fragment is
A: First Question: In the cout statement, the expression follows the rules of operator precedence and…
Q: Convert the following code into descriptive code, and verify using White Box Testing.
A: White Box Testing White Box Testing is software testing technique in which internal structure,…
Q: In the given code below we want to swap a and b. a -What is the problem with code b- Fix the code by…
A: Given Code always @ (posedge clk) begin a=b; b = a; end A) There is a problem with…
Q: Please create a code that solves for matrix addition and matrix scalar multiplication. The code for…
A: Answer: I have done code in python as also I have attached code
Q: What is the output of this code
A: In this question, a code segment is given and we are asked to give the correct output Given Code:
Q: What is the output of the :following code
A: C++ programming language is known to be case sensitive which means uppercase and lowercase letters…
Q: c1 ='a'while c1 <'b': c2 ='a'while c2 <='c':print('{}{}'.format(c1, c2), end=' ') c2 =chr(ord(c2)+1)…
A: Output of the above code is
Q: Examine the following codes and evaluate what will be the output. Write the output in the space…
A: Program Explanation: A class with main method is defined Three integer variables are declared and…
Q: Which of the following lines of code returns an error?
A: Given:
Q: Complete the convert() function that casts the parameter from a float to an integer and returns the…
A: Given: To write a function convert () that casts the float to int and then return the result.
Q: output is produced when previous1 = 1,
A: Given :- In the above question, the algorithm is mention in the above given question Need to write…
Q: write the missing code
A:
Q: I'm getting this error for the above code
A: I checked code that is right code for binary search:…
Q: Given the following code what will be the output?
A: Java is a programming language. It contains extensive libraries (package). It can be used to create…
Q: A1. Find the output of the following code in order.
A: Here, the concept of constructor chaining is used. Constructing an instance of a class invokes or…
Q: what is the worst case of the code below
A: Task :- find out the worst case runtime of the given code.
please try to code them and send the output
Step by step
Solved in 4 steps with 2 images
- JSON Response example when code = BAHRAIN as follows: { "Country": "Bahrain", "Tenps"il ("day": "SUNDAY", "temp"i {"day": "HONDAY", "temp": 35), ("day": "TUESDAYr, "teng": 39), ("day": "WEDNESDAY", "tenp": 37),. ("day"i "THURSDAY", "tenp": 35), ("day"i "FRIDAV", "temp": 34), ("day": "SATURDAY", "teng": 37) 1. Implement find Templ ) function as follows: Sample Eample This function will be called whenever the user change the value of the pull-down menu. This function should contact Ve the Web Service API, sending the selected country code, to Co display the information (country, daily temperatures in the week and average weekly temperature) inside the div tag whose id -result as shown in the example on the right. Country ahraln In addition, the country name and the average temperatures should be saved as one JS object inside an array in a local storage. Whenever new request is made, the countrylaverage will be saved and added to the array inside the local storage (duplicates is allowed).…LOVELY PROFESSIONAL UNIVERSITY Academic Task No. 1 School : of Computer Science and Engineering Name of the faculty member_Ms. Gauri Mathur_ Course Code: CSE202 Faculty of: Technology and Sciences Course Title: Object Oriented Programming Program: Max. Marks: 30 Term: Is Rubric Applicable: No Date of Allotment: 26/02/2021 Date of Submission: 09/03/2021 Important Guidelines: 1. All questions in this Academic Task are compulsory. 2. It is mandatory to attempt all questions of the assignment in your own handwriting on A4 size sheets/pages with a blue colour ink pen. Any other mode of attempt (typed or printed codes or table) except hand written/drawn will not be accepted/considered as valid submission(s) under any circumstances. 3. Every attempted sheet/page should carry clear details of student such as Name, Registration number, Roll number, Question number and Page number. The page numbers should be written clearly on the bottom of every attempted sheet in a prescribed format as: for…Screen Output #include #include #define MAX 3 typedef struct { char part[20]; int quantity; float price; }partsRecord; void myParts (void); void printBin(partsRecord *recBin); int main(void) { myParts(); return(0); } void myParts (void) { partsRecord Bin[MAX] = { { "Resistor", 300, 0.05 }, { "Capacitor", 250, 1.03 }, { "Inductor", 123, 0.65 }}; int index; for (index { 0; index part, recBin->quantity, recBin->price); return; } 2c) What type of argument is passed to the printBin function?
- C++ complete and create magical square #include <iostream> using namespace std; class Vec {public:Vec(){ }int size(){return this->sz;} int capacity(){return this->cap;} void reserve( int n ){// TODO:// (0) check the n should be > size, otherwise// ignore this action.if ( n > sz ){// (1) create a new int array which size is n// and get its addressint *newarr = new int[n];// (2) use for loop to copy the old array to the// new array // (3) update the variable to the new address // (4) delete old arraydelete[] oldarr; } } void push_back( int v ){// TODO: if ( sz == cap ){cap *= 2; reserve(cap);} // complete others } int at( int idx ){ } private:int *arr;int sz = 0;int cap = 0; }; int main(){Vec v;v.reserve(10);v.push_back(3);v.push_back(2);cout << v.size() << endl; // 2cout << v.capacity() << endl; // 10v.push_back(3);v.push_back(2);v.push_back(3);v.push_back(4);v.push_back(3);v.push_back(7);v.push_back(3);v.push_back(8);v.push_back(2);cout…int main(){Book * book1 = new Book("Learning Python","David Ascher");Book * book2 = new Book("C++ Primer","Scott Meyers");Category * cs = new Category("Computer Science","A");Category * pl = new Category("Programming Languages","A1");pl->add(book1);pl->add(book2);cs->add(pl);Category * swe = new Category("Software Engineering","A2");cs->add(swe);Category * os = new Category("Operating Systems","A3");cs->add(os);cout << "Total number of books in library is " << cs->count() << endl;return 0;} class IndexItem {public:virtual int count() = 0;virtual void display()= 0;}; class Book : public IndexItem {private:string title;string author;public:Book(string title, string author): title(title), author(author){}virtual int count(){return 1;} virtual void display(){/* YOU DO NOT NEED TO IMPLEMENT THIS FUNCTION */}}; class Category: public IndexItem { private: /* fill in the private member variables for the Category class below */ ? public: Category(string…struct Player { string firstName; string lastName; int hits; int runs; }; int main() { Player p = { "Jackie", "Robinson", 1518, 947 }; Player team[24]; Player *tPtr = team; team[0] = p; // INSERT CODE HERE } The statement tPtr = team+9; will assign the same memory address to tPtr as the statement tPtr = &(team[9]);#include<bits/stdc++.h>using namespace std; // Class representing music dataclass Song {public:string musicName, musicDescription;};// Function to take input for music descriptionSong addDescription(){Song s1;cout<<"Enter the Music name : ";cin>>s1.musicName;cout<<"Enter the Music description : ";cin>>s1.musicDescription;return s1;} // Function to write music object details into a txt filevoid storeInfoToDatabase(Song s){ofstream fileObject;// Opening the file in append modefileObject.open("Database.txt", ios::app);fileObject << s.musicName;fileObject << " ";fileObject << s.musicDescription;fileObject << "\n";} // Driver Functionint main(){Song s = addDescription();storeInfoToDatabase(s);cout<<"Data written into file succesfully...";return 0;}Write a function getNeighbors which will accept an integer array, size of the array and an index as parameters. This function will return a new array of size 2 which stores the neighbors of the value at index in the original array. If this function would result in returning garbage values the new array should be set to values {0,0} instead of values from the array.#include #include #include "Product.h" using namespace std; int main() { vector productList; Product currProduct; int currPrice; string currName; unsigned int i; Product resultProduct; cin>> currPrice; while (currPrice > 0) { } cin>> currPrice; main.cpp cin>> currName; currProduct.SetPriceAndName (currPrice, currName); productList.push_back(currProduct); resultProduct = productList.at (0); for (i = 0; i < productList.size(); ++i) { Type the program's output Product.h 1 CSE Scanned Product.cpp if (productList.at (i).GetPrice () < resultProduct.GetPrice ()) { resultProduct = productList.at(i); } AM cout << "$" << resultProduct.GetPrice() << " " << resultProduct. GetName() << endl; return 0; Input 10 Cheese 6 Foil 7 Socks -1 OutputC code Blocks Select all of the code segments that are the correct way to define a variable class as an array of 185 personal structures. struct personal { int id; // id numberchar name[80];}; Options: a .personal class[185]; b. struct personal class[185]; c. typedef struct personal classStruct;classStruct class[185]; d. typedef class[185];/* Movie List Example --Showing how to use vectors and structures */ #include <iostream> #include <iomanip> #include <string> #include <vector> using namespace std; // define a struct for a Movie object struct Movie // It is common for the struct name to be capitalized { string title = ""; // First member of structure - and initialized int year = 0; // Second member of structure - and initialized }; int main() { cout << "The Movie List program\n\n" << "Enter a movie...\n\n"; // get vector of Movie objects vector<Movie> movie_list; char another = 'y'; while (tolower(another) == 'y') { Movie movie; // make temporary new (initialized) Movie object cout << "Title: "; getline(cin, movie.title); cout << "Year: "; cin >> movie.year; movie_list.push_back(movie);…SEE MORE QUESTIONS