How many total stars will be displayed by each of the following program segments? A) for (row = 0; row < 20; row++){ for (star = 0; star < 30; star++) { cout << '*';}cout << end1; }B) for (row = 0; row < 20; row ++) { for (star = 0; star < 30; star++) { if (star > 10)break; cout << '*'; }cout << end1; }
Q: Module main() // Local variables Constant Integer SIZE = 12 Declare String month[SIZE] =…
A: Given: Module main() // Local variables Constant Integer SIZE = 12 Declare String month[SIZE] =…
Q: ***** Price Markup Calculator ********* Enter Item Amount: 224.47 Markup At: 10% 20% 30% 40% 50%…
A: PROGRAM INTRODUCTION: Start the while loop for the initial step during entering the value of the…
Q: NumPy program that displays a square matrix whose elements below the principal diagonal are zero…
A: Below the NumPy program that displays a square matrix whose elements below the principal diagonal…
Q: void showValues(int a[4]), int cols = 5) { for (int roW = 1; row <= 4; row++) for (int col = 1; col…
A: Task :- Identify the errors in given piece of code.
Q: Double any element's value that is less than minValue. Ex: If minValue = 10, then dataPoints = {2,…
A: Completing the given C++ program so, that it can follow the given rubrics:The array is already…
Q: ** Price Markup Calculator ********* Enter Item Amount: 224.47 Markup At: 10% 20% 30% 40% 50% 246.92…
A: PROGRAM INTRODUCTION: Start the while loop to validate the data entry until the user enters the…
Q: The main function creates 5 pixels with random red, green, and blue values. Complete the id_color…
A: So you create a pixel inside the main function five times (using for loop) and you call the…
Q: three textbox arrays A1, A2, A3 contains degrees of 10 stu * three materials. The code to find the…
A: Here we need to add values of A1, A2 and A3. This makes option (a) and (d) incorrect.
Q: aucts are sóld from a vending machine, which has two push buttons P, and P. When a button is…
A: Introduction :Here we have asked to calculate the expression for "d"
Q: Using C++ Write a program that can be used to assign seats for a commercial airplane. The airplane…
A: Program Instruction The program prompts the user to enter Ticket type as FC for first class, BC…
Q: The dblNums array is a six-element Double array. Which of the following If clauses determines…
A: The if statement “if intSub > dblNums.GetUpperBound(0) Then” searches the entire array. Hence…
Q: characters that represents a maze. Each position can contain either an X or a blank. Starting at…
A: Write a function that accepts an 8 by 8 array of characters that represents a maze. Each position…
Q: (Comparing Integers) Write a program that prompts the user to enter the edges of a triangle and…
A: PROGRAM CODE: #include<iostream>using namespace std;int main(){ int side1, side2, side3; cout…
Q: The "chart.colors.ranges" property for level A is set in the following code using arrays. What is…
A: Looking at code we can see that, in the "else" part of code logic, we are inserting the values into…
Q: Comm Target Outcome: (CO2) Write algorithms to solve different programming problems using flowchart…
A: Here we make simple flow chart:===================================================================
Q: Q.1.1 Create a two-dimensional array to contain the three sale items for five different artists. A…
A: Array is a data structure which contiguously stores the variable and it can be accessed by the array…
Q: using the column operator (:), create a column vector that contain all the column of A A=(13 7. 3. 4…
A: A column vector is a column of entries.
Q: Problem Descriptions: In this problem, your task is to write a program to find whether a…
A: Since no specific language is mentioned so writing the program in C++ language. CirclePoint.cpp…
Q: Assignment: Sidewalk Have Turtle draw a sidewalk around the perimeter of 400x400 px The sidewalk…
A: Answer: I have done code and also I have attached code and code screenshot as well as output
Q: 2.15 (Geometry: area of a hexagon) Write a program that prompts the user to enter the side of a…
A: Given: To write a python program to find the area of hexagon.
Q: reate 4 Box objects (at least one should be created using copy constructor). Display number of…
A: reate 4 Box objects (at least one should be created using copy constructor). Display number of…
Q: 5-27) (Display leap years) Write a program that displays all the leap years, ten per line, from two…
A: Note: The below program has been complied and executed in NetBeans IDE 8.2
Q: ======= Office Pay Roll System ========= • Enter ‘r, to take information of all the employee into…
A: Given: • Enter ‘r, to take information of all the employee into the Employee structure array of size…
Q: allow data to be continuously input for more customer's information such as customer's name and…
A: I have re-written the code with the input of the customer's name and phone number.…
Q: 1. The main function creates 5 pixels with random red, green, and blue values. Complete the id_color…
A: For the above program, An Image with a single-pixel was created and passed as an argument to the…
Q: Test Case 4 How many integers do you have? (Max 20) \n -40 ENTER You must enter a number in between…
A: - We need to highlight the correct code for the given scenario.
Q: Create a Windows Form Application project. with C#, using random values in an array or loop. The…
A: C# Program: using System; using System.Collections.Generic; using System.ComponentModel; using…
Q: OddFib.py 1 #Recall that Fibonacci's sequence is a sequence of numbers 2 #where every number is the…
A: Step-1: StartStep-2: Call function oddfib and pass 3 as an argument, print return valueStep-3: Call…
Q: Question 1 Write a statement that declares a string arrays initialized with the following strings:…
A: Since no programming language is mentioned I am using c++ Algorithm: 1. Start 2. Initialize string…
Q: python coding (Pandas: Series) Perform the following tasks with pandas Series: a) Create a Series…
A: Note: As per bartleby policy we can answer first 3 options or question at a time so if you want the…
Q: Write a program that generates a two-column table showing Fahrenheit temperatures from -40F to 120F…
A: 1. declare variable Celsius initialized with 0.0 2. run loop from 0.0 to 120.0 with increment of 5…
Q: Question 18 D The following question uses a robot in a grid of squares. The robot is represented as…
A: The following code segment moves the robot around the grid. Assume that n is a positive integer.…
Q: 2) Minimize the following DFA (use the tabular method explained in the lecture notes and class).…
A:
Q: Write a program that animates the linear search algorithm. Create a list that consists of 20…
A: Program Plan: • Create a window, set its title. • Create a canvas and add it to window. • Create and…
Q: An n xn matrix that is filled with the numbers 1, 2, 3,. .., n° is a magic square if the sum of the…
A: Here is the approach : First create the list with four more list . In every list we will have 4…
Q: TicTacToeCreate the board display the board Set token to ‘x’Loop //at most 9 times, but end loop…
A: PROGRAMMING APPROACH: // defining header file. // inside the board array of size 17*17. // using the…
Q: Ask the user to enter the amount of money he or she wants to insert into the slot machine. Instead…
A: The moment you read the word 'randomly' in a question, you should immediately start thinking about…
Q: Create a string variable containing your full name (with spaces) 2) print the string as shown below…
A: Program: #include<string>#include <iostream> using namespace std; //Function to print…
Q: Using C++ Write a program that can be used to assign seats for a commercial airplane. The airplane…
A: The program prompts the user to enter Ticket type as FC for first class, BC for Business Class, EC…
Q: Create a one dimensional array that contains the following: "Cath, Donna, Anna, Bob, Mae". Write a…
A: I give the code in C# along with output and code screenshot
Q: Write a For Next loop that adds the following set of values to the list box IstValues. 0,5,10,15,…
A: SUMMARY: -Hence, we discussed all the points.
Q: 3. The following program loads and displays an image. Complete the draw_border function to draw a…
A: You need to import Image and ImageOps module to accomplish this task as shown in the sreenshot in…
Q: Jaimey 85* Jessica 62 Georgia 81 Jaden 85* Program has two arrays, namely, name and mark array.…
A: The ask is to display the name and the associated marks on the console window. Additionally it asks…
Q: True or false: the points() function adds data points to an existing plot. O bar box and whisker…
A: Points() function in R programming language is used to add a group of points of specified size,…
Q: The intNum array is declared as follows: Dim intNum(,) As Integer = {{6, 12, 9, 5, 2}, {35, 60, 17,…
A: Visual Basic allows 2 separate ways to create an array. One way is to create an array with initial…
Q: Ask the user for an input (an image file). If the file uploaded is not a jpeg/jpg file, print out…
A: Answer: I have done code in python and as well as attached code screenshot.
Q: The show_sequence function at below is part of chapter 3 program. What kind of passing does this…
A: It uses a general parameter. The reason is that, we don't want the advancing of the current element…
Q: program segment to find the location i such that A (i) contains the largest value in A. Also, find…
A: Answer :- In the form design add two labels with text List of Numbers and List of Odd Numbers.…
Q: Geometry: area of a pentagon) Write a program that prompts the user to enter the length from the…
A: Declare double type variables to store side and area of pentagon. Read distance from centre to…
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
How many total stars will be displayed by each of the following program segments?
A) for (row = 0; row < 20; row++)
{ for (star = 0; star < 30; star++)
{ cout << '*';
}
cout << end1;
}
B) for (row = 0; row < 20; row ++)
{ for (star = 0; star < 30; star++)
{ if (star > 10)
break; cout << '*';
}
cout << end1;
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- 1. The main function creates 5 pixels with random red, green, and blue values. Complete the id_color function to return “red” if the red value is greater than the green and blue, “green” if the green value is greater than the red and blue, and “blue” if the blue value is greater than the red and green. If there is no clear maximum value (for example, if the red and green values are the same) return None. Do not change the main function.5-27) (Display leap years) Write a program that displays all the leap years, ten per line, from two positive integer year periods entered by the user , separated by exactly one space. Although it is only an approximation consider any year a leap year if it divisible by 4. Also display the number of leap years in this period.Assignment Description This program will simulate part of the game of Yahtzee! This is a dice game that involves rolling five dice and scoring points based on what show up on those five dice. The players would record their scores on a score card, and then total them up, and the player with the larger total wins the game. A Yahtzee score card has two portions: The upper portion has spaces for six scores, obtained by adding up all of the 1's, 2's, 3's, etc. The lower portion has special scores for various combinations: Three of a kind -- at least 3 dice are the same number;the score is the sum of all five dice Four of a kind -- at least 4 dice are the same number;the score is the sum of all five dice Small straight -- four consecutive numbers are represented, e.g. 2345;the score is 25 points Large straight -- five consecutive numbers are represented, e.g. 23456;the score is 30 points Full House -- three of one kind, two of another; the score is 30 points Yahtzee! -- five of a kind; the…
- Question 18 D The following question uses a robot in a grid of squares. The robot is represented as a triangle, which is initially facing toward the top of the grid. The following code segment moves the robot around the grid. Assume that n is a positive integer.Design a program that allows two players to play a game of tic-tac-toe. Use a two dimensional String array with three rows and three columns as the game board. Each element of the array should be initialized with a asterisk (*). The program should run a loop that does the following: Display the contents of the board array. Allows player 1 to select a location on the board for an X. The program should ask the user to enter the row and column number. Allows player 2 to select a location on the board for an O. The program should ask the user to enter the row and column number. Determines whether a player has won or if a tie has occurred. If a player has won, the program should declare that player the winner and end. If a tie has occurred, the program should say so and end. Player 1 wins when there are three X's in a row on the game board. Player 2 wins when there are three O's in a row on the game board. The winning X's or O's can appear in a row, in a column, or diagonally…1. [LO 1, LO 2, LO 3 & LO 4, Treasure Hunter Description You are in front of a cave that has treasures. The cave can be represented in a grid which has rows numbered from 1 to , and columns numbered from 1 to . For this problem, define (x,y ) as a tile that is in the the-x row and the y-row. There is a character in each tile, which indicates the type of that tile. Tiles can be floors, walls, or treasures which are represented respectively by the characters '.' (period), '#' (hashmark), and '*' (asterisk). You can go through the floor tiles and treasures, but you can't get past the wall tiles.Initially, you are in a tile (??, Sy). You want to visit all the treasure squares, and retrieve the treasure. When you visit a treasure tile, the treasure is instantly retrieved, and the tile turns into a floor.In a move, if you are on a tile (?,y), then you can move to the right tile above (?-1,y), right (?,y + 1), down (? + 1, ), and left (?, 1) of the current tile. The tile you visit must…
- The intSales array is declared as follows: Dim intSales() As Integer = {10000, 12000, 900, 500, 20000}. The statement intSales (2) += 10 will _____. replace the 900 amount with 10 replace the 900 amount with 910 replace the 12000 amount with 10 replace the 12000 amount with 12010The show_sequence function at below is part of chapter 3 program. What kind of passing does this function us and why? void show_sequence(sequence display) // Library facilities used: iostream{ for (display.start( ); display.is_item( ); display.advance( )) cout << display.current( ) << endl;} Group of answer choices It uses a value parameter. The reason is the advancing of the current element through the sequence would alter the actual argument. That is what we want. It uses a value parameter. The reason is the we don't want the advancing of the current element through the sequence to alter the actual argument. It uses a geneeral parameter. The reason is the we don't want the advancing of the current element through the sequence to alter the actual argument. It uses a reference parameter. The reason is the we don't want the advancing of the current element through the sequence to alter the actual argument. It uses a reference parameter. The reason is…Write a program that shows Game sales. The program should use a structure to store the following data about the Game sale: Game company Type of Game (Action, Adventure, Sports etc.) Year of Sale Sale Price The program should use an array of at least 3 structures (3 variables of the same structure). It should let the user enter data into the array, change the contents of any element and display the data stored in the array. The program should have a menu driven interface. Input Validation: When the data for a new game sale is entered, be sure the user enters data for all the fields. No negative amounts should be entered for a “Sale Price” of the Game An example: You will use 1 structure only and then manipulate that for working with the information. The program should use an array of at least 3 structures (3 variables of the same structure). An example of the structure:struct Game{string name;string type;int year;double price;}; So far I have written that ...
- Q1) Use the source code enhance your program above as follows (include a loop structure): • allow data to be continuously input for more customer's information such as customer's name and phone number. #include <stdio.h> #include <stdlib.h> #include<string.h> #pragma warning(disable:4996) int main(void) { //Package category array char category[] = { 'A', 'B', 'C', 'D' }; //Price array float price[] = { 24.50, 26.00, 27.50, 29.00 }; //Quantiy array int quantity[] = { 0, 0, 0, 0 }; int count = 1; int qtyA = 0, qtyB = 0, qtyC = 0, qtyD = 0,n[20]; float total = 0.0, discount = 0.0, delivery = 0.0, net = 0.0; char ch = 'A', choice = 'Y'; printf("\n<MENU PRICES OF VEGETABLE>"); printf("\n==============================================================================="); printf("\n MR.KOK VEGETABLE ORDERING SYSTEM"); printf("\n==============================================================================="); //Continue taking customer input till choice is not 'N' or…CIS 2275 C++ Programming Part I Program 6 Trivia Game In this program, create a simple trivia game for two players. It will work like this: Starting with player 1, each player gets a turn at answering five trivia questions. There are a total of 10 questions. When a question is displayed, four possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, they earn a point. After the answers have been selected for all of the questions, the program displays the number of points earned by each player and declare the player with the highest number of points to be the winner. The players will have the option of playing another round. The flow of the program will be: 1. Show the Header information. 2. Create an array of Question structs. 3. Read the questions from the text file. 4. If the questions were properly read, start a do-while loop. 5. Declare and initialize: a. playerOnePoints and playerTwoPoints b. questionNumber…CIS 2275 C++ Programming Part I Program 6 Trivia Game In this program, create a simple trivia game for two players. It will work like this: Starting with player 1, each player gets a turn at answering five trivia questions. There are a total of 10 questions. When a question is displayed, four possible answers are also displayed. Only one of the answers is correct, and if the player selects the correct answer, they earn a point. After the answers have been selected for all of the questions, the program displays the number of points earned by each player and declare the player with the highest number of points to be the winner. The players will have the option of playing another round. The flow of the program will be: Show the Header information. Create an array of Question structs. Read the questions from the text file. If the questions were properly read, start a do-while loop. Declare and initialize: playerOnePoints and playerTwoPoints questionNumber start a while loop - while…