What does the following program print? #include using std::cout; using std::endl; int main() { int count = 1; while ( count <= 10 ) { cout << (count % 2 ? "****" : "++++++++") << endl; ++count;} return 0;}
Q: TCP (Transport Control Protocol) is a transport layer protocol that offers full duplex, connection-o...
A: In the given problem, we will discuss about the TCP protocol.
Q: Number of characters in a string
A: Correct answer is "A" (number of characters in a string).
Q: What is containment, and why is it part of the planning process?
A: Answer: Containment : It is a action which is take to make things under control and in a limits so t...
Q: Answer questions 2.1 to 2.4 based on the following schema. Note that primary keys are in BOLD. Note ...
A: Here have to determine sql query statement for given problem.
Q: ii) WAP to demonstrate the use of foreach loop on an array of strings, declare an array of strings a...
A: Write a program in Perl programming language to demonstrate the use of foreach loop on an array of s...
Q: Compute the weakest precondition for the following assignment. a = 2 * (b - 1) - 1{a > 0}
A: The Answer is
Q: In this sample web address, which part identifies the name of the Web server? http://www.example.co...
A: a. Example com This area is for use in illustrative models in reports. You might utilize this area i...
Q: Describe purpose of UIDL POP3 Command.
A: The question is to describing the purpose of UIDL POP3 Command.
Q: The Bootstrap grid system works across multiple devices. False/True
A: Grid system is used for creating web page layout. Bootstrap layout grid example For proper alignmen...
Q: Briefly explain whether you can create your system database or any database and put it in the System...
A: Briefly explain whether you can create your system database or any database and put it in the System...
Q: Given a problem and correct (shuffled) program, re-arrange the shuffled code segments in the correct...
A: #include<iostream>#include<cmath>#include <iomanip> #include <cstring>usin...
Q: 5 32 bits in bc r has latency has latency the hit latenci associative
A:
Q: Simplify the following expression using tabulation method: F(x,y,z) = y’z + x’y + xy’z’
A:
Q: For the following questions (c) and (d), assume n is a power of 2, i.e. n = 2k. for (cnt3 0, i for (...
A: Find the time complexity using summations method
Q: Explain the working of XML processors in detail. Also mention the purpose of XML processors.
A: The Answer is
Q: What security issues will need to be addressed for a Parking management system (application) all the...
A: Robbery of individual information. As the quantity of sensors increment quickly in vehicles, there i...
Q: In this section, we will define and analyze the CIA trend, as well as compare the three CSMA protoco...
A: A avoid confusion with the Central Intelligence Agency, the idea is also referred to as the AIC trio...
Q: Using your own words, explain in 11 lines the Hadoop Ecosystem
A: GIVEN: Using your own words, explain in 11 lines the Hadoop Ecosystem
Q: Note that primary keys are in BOLD. Note also that attributes with the same name in different tables...
A: Solution: 2.3) Treatment table before increment by 2.5 % in costOfTreatment :
Q: You need to calculate your average grade for Problem solving course. There are three marks midterm (...
A: Here are three marks midterm (30%), quiz (20%) and final (50%)
Q: Can you give me your best recommendation for alternative input devices? Explain
A: input devices are those which are used by us to give information to computers.
Q: 74LS138 Decoders (used to generate CS signals for memory devices) can be replaced with NAND gates on...
A: Given:
Q: Patient ( www er, firstName:varchar(20), Answer questions 2.1 to 2.4 based on the following schema. ...
A: Solution: 2.1) Creating Treatment table: CREATE TABLE Treatment( doctorId integer PRIMARY KEY,...
Q: Use floyed Warshall algorithm
A: Solev b,c use floyed Warshall algorithm like given example
Q: Note that primary keys are in BOLD. Note also that attributes with the same name in different tables...
A: Here have to determine about SQL statement of given problem statement.
Q: Unlike earlier telecom networks, most modern networks are _______ end-to-end. a. cellular b...
A: Required: Unlike earlier telecom networks, most modern networks are _______ end-to-end.
Q: 10000 – 111 = 2. 1010101 + 10101 = 3. 11010 x 11 = 4. 101011 divided by 10 = 5. 11001 – 111 =
A: Solved the given boolean values
Q: 4. During the semester, we defined Methodologies and SDLC. Explain the SDLC and how it relates to So...
A: The Software Development Life a Cycle (SDLC) is a technique for producing high-quality software that...
Q: Question 4: Write a JAVA program to take input an integer num from user and in output print the valu...
A: Given: An integer num taken input from user. Requirement: Write a JAVA program to take input from us...
Q: Evaluate three online cloud storage providers and compare their features, positives and negatives.
A: Given: Evaluate three online cloud storage providers and compare their features, positives and n...
Q: What is the Sliding Window Protocol, and why is it preferable to the simplex protocol in this case? ...
A: Sliding Window Protocol is a data connection layer for delivering data frames in a reliable and sequ...
Q: FAs to REs
A: The given FA1 to regular expression
Q: What are Real numbers?
A: According to our restrictions we are allowed to answer the first question only. Kindly ask the remai...
Q: Assume we have two relations R(a,b) and S(b,c). All three attributes (a, b, and c) are integer attri...
A: Lets see the solution in the next steps
Q: In this section, we will define and analyze the CIA trend, as well as compare the three CSMA protoco...
A: Carrier Sensory Multiple Access (CSMA) is a technique that ensures the absence of other traffic prio...
Q: How can we write string in multiple line using javascript.
A: To be determine: How can we write string in multiple line using javascript.
Q: Give the flowgraph of the approach used with Dijkstra's selector statement.
A: The Answer is
Q: t connects all departments
A: A network is created of 2 or a lot of computers that square measure connected along via cables (wire...
Q: Eliviya had a string and she wants to convert this string to words array without using any loop . Yo...
A: Requirements:- Eliviya had a string and she wants to convert this string to a words array without us...
Q: Construct: C Translation: T(C) do! e се if ethen ce for pat in e do ce let! pat = e се return e retu...
A: Solution is given below:
Q: Postulates: 1. If Mary watches the news, she becomes depressed. 2. Zach will ask Mary for a date if ...
A: Below are the conclusions with explanation:
Q: Here complete the query to displays the unique values of the column: SELECT ________ dept_name FROM...
A: given: SELECT ________ dept_nameFROM instructor;
Q: What should you keep in mind while upgrading your laptop's components?
A: GIVEN: What should you keep in mind while upgrading your laptop's components?
Q: which optical cable is best suited for LANs ?
A: GIVEN: Which optical cable is best suited for LANs?
Q: Two massively powerful computers are transmitting and receiving data. Can we still have congestion? ...
A: Congestion in the nasal passages may be triggered by anything that irritates or inflames the nasal t...
Q: In X86 Assembly language: Write a procedure to check if a number is divisible by an other number...
A: Solution: Write a procedure to check if a number is divisible by an other number: isDivisible(i...
Q: 3 if-then and if-then-else statements Use program Pressure for exercises 4-5. // Program Pressure pr...
A: Requirement- Show warning if pressure entered exceeds 100. Solution: We can add a if statement wit...
Q: write a backlog table for an ecommerce website
A: An product backlog is a rundown of the new elements, changes to existing components, bug fixes, fram...
Q: Investigate the effect of wireless networks in developing and developing nations. If LANs and physic...
A: - The question wants to know :- Effect of wireless network in developing and developed nations. Why...
Q: Provide a brief description of the advantages and disadvantages of connectionless protocols as compa...
A: The same route is followed by all packets between the source and destination. It is not necessary to...
What does the following program print?
#include
using std::cout;
using std::endl;
int main()
{ int count = 1;
while ( count <= 10 )
{ cout << (count % 2 ? "****" : "++++++++") << endl;
++count;}
return 0;}
Step by step
Solved in 2 steps with 2 images
- The Lo Shu Magic Square is a grid with 3 rows and 3 columns. The Lo Shu Magic Square has the following properties: The grid contains the numbers 1 – 9 exactly The sum of each row, each column and each diagonal all add up to the same number. Write a program in C++ that simulates a magic square using 3 one dimensional parallel arrays of integer type. Do not use two-dimensional array. Each one the arrays corresponds to a row of the magic square. The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not. Processing Requirements - c++ Use the following template to start your project: #include<iostream> using namespace std; // Global constants const int ROWS = 3; // The number of rows in the array const int COLS = 3; // The number of columns in the array const int MIN = 1; // The value of the smallest number const int MAX = 9; // The value of the largest number // Function prototypes bool…Number guessing Game Write a C program that implements the “guess my number” game. The computer chooses a random number using the following random generator function srand(time(NULL)); int r = rand() % 100 + 1; that creates a random number between 1 and 100 and puts it in the variable r. (Note that you have to include <time.h>) Then it asks the user to make a guess. Each time the user makes a guess, the program tells the user if the entered number is larger or smaller than its number. The user then keeps guessing till he/she finds the number. If the user doesn’t find the number after 10 guesses, a proper game over message will be shown and the actual guess is revealed. If the user makes a correct guess in its allowed 10 guesses, then a proper message will be shown and the number of guesses the user made to get the correct answer is also printed. After each correct guess or game over, the user decides to play again or quit and based on the user choice, the computer will make…in C++ : What does Listing 1-1 do? Listing 1-1. /// Read the program and determine what the program does. import <iostream>; import<limits> ; int main() { int min{std::numeric_limits<int>::max()}; int max{std::numeric_limits<int>::min()}; bool any{false}; int x; while (std::cin >> x) { any = true; if (x < min) min = x; if (x > max) max = x; } if (any) std::cout << "min = " << min << "\nmax = " << max << '\n'; }
- (Rounding Numbers) An application of function floor is rounding a value to the nearestinteger. The statementy = floor(x + .5);will round the number x to the nearest integer and assign the result to y. Write a program that readsseveral numbers and uses the preceding statement to round each of these numbers to the nearestinteger. For each number processed, print both the original number and the rounded number.Define the function: int power (int base, int exp) {/*It accepts the arguments for base and exponent and returns power. The algorithm is to repeatedly multiply the value of the base to how many times the value of exponent. Test the function inside main(). Write the complete C program. */} For example: Intput. Result 2 32 5Language: Python 3 A particular talent competition has 5 judges, each of whom awards as score between 0 and 10 to each performer. Fractional scores, such as 8.3, are allowed. A performer's final score is determined by dropping the highest and lowest score received, then averaging the 3 remaining scores. Write a program that uses these rules to calculate and display a contestant's score. It should include the following functions: -getJudgeData() should ask the use for a judge's score, store in a parameter variable, and validate it. This function should be called by main program once for each of the 5 judges. -calcScore(score1, score2, score3, score4, score5) should calculate and return the average of the 3 scores that remain after dropping the highest and lowest scores the performer received. This function should be called just once by main and should be passed the 5 scores. Two additional functions, described below, should be called by calcScore, which uses the returned information to…
- In C++: Examine the code segment. What will be printed? If there are any errors indicate the nature of each error. int a[7] = {31, 12, 32, 14, 25, 16, 27}; int *ptr; ptr = & a[2]; for ( i=1; i<=5; i=i+2) cout << *(ptr +i); cout << a[0] << *ptr << *ptr - 2 << *(ptr -1)) << endl;What will be the contents of sum? in c # include <stdio.h> int main(void) { unsigned int sum = 0; for (unsigned int count = 1; count <= 99; count += 2) { sum += count; } printf("%d ", sum); }(Initialize array) Write a function called initializeArray that receives an array, its size, and two integers and initializes the array with random values between the first integer and the second integer. Write another function called printArray that receives an array and its size and prints the array elements in a column. Write a test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive, and then prints the array using the above functions Write a C++ program that declares and initializes an integer array of size 100 with random integers between 1 and 10 inclusive using initializeArray (from question 1) and counts the occurrence of each number in the array and graphs the information in the form of a bar chart or histogram—each number is printed, then a bar consisting of that many asterisks is printed beside the number. Here is a sample run of the program: Number Value Histogram 1…
- (Initialize array) Write a function called initializeArray that receives an array, its size, and two integers and initializes the array with random values between the first integer and the second integer. Write another function called printArray that receives an array and its size and prints the array elements in a column. Write a test program that declares and initializes an array of size 20 with random values between 0 and 10 inclusive, and then prints the array using the above functions Write a C++ program that declares and initializes an integer array of size 100 with random integers between 1 and 10 using initializeArray (from question 1) and counts the occurrence of each number in the array and prints the occurrences. Note: Print time or times correctly. Hint: Declare another array called count that stores the number of each value as you count the numbers of the original array. Use printArray (from question 1) to print the values of count. Here is a sample run of the program: 1…5: CheckLetter.cpp) Write a program that adds a checkletter to an eight-digit number. The check letter should becomputed as follows: Break the number up into 4 two-digitnumbers. Add the four numbers together. Find theremainder after division by 26. The check letter is the letterin the alphabet that corresponds to the number justcomputed. (A=0, B=1, C=2, etc.) Print the original numberfollowed by the check letter. Use at least one ffunction thatreturns a value when you write this program.This is a tic tac toe program i made. Help me debug it. This is in c programming. Here is the code: #include <stdio.h> /*int board[25] = { :,:,:,:,:, :,O,-,X,:, :,X,-,-,:, :,-,-,-,:,}*/ const NOUGHTS = 1;const CROSSES = 2;const BORDER = 3;const EMPTY = 0; const int ConvertTo25{9} = { 6,7,8, 11,12,13, 16,17,18}; void InitialiseBoard(int*board) { int index = 0; for (index = 0; index < 25; ++index) { board[index] - BORDER; } for (index = 0; index < 9; ++index) { board[ConvertTo25[index]] - EMPTY; }} void PrintBoard(const int*board) { int index = 0; printf("\nBoard:\n"); for (index = 0; index < 25; ++index) { if (index!=0 && index%==0) { printf("\nBoard:\n"); } printf("%4d",board[index]); } printf("\n"); } int main() { int board[25]; InitialiseBoard(&board[0]); PrintBoard(&board[0]); return 0;}