if (ages >= 16) 20; if (count % 10 cout << count << endl; else 0) ticketPrice else ticketPrice 10; cout << count << " ";
Q: def flag(height): t.color("red") a = 165 for i in range(7): t.down () t.begin_fill() t.forward(long)…
A: Problem to convert the given code into R code. Code given:
Q: T F: The string concatenation operator automatically inserts a space between thejoined strings.
A: String concatenation means appending a string in front of other string. The code is strcat (str1,…
Q: hallenge Problem (pyhton) T E S T S C O R E S Write a program that…
A: Program Approach: 1- As mentioned in the assignment created the main function. 2- def keyword used…
Q: The first 25 prime numbers (all the prime numbers less than 100) are: 2, 3, 5, 7, 11, 13, 17, 19,…
A: Below is the required C code. Approach of a Program: Include a necessary header files to get the…
Q: The following statement should determine whether count is outside the range of 0 through 100.What is…
A: Error: The AND (&&) operator has been used in the statement.Explanation: Since the operator…
Q: Marketing person contains the values { total product sales, commission rates, person base salary}.…
A: The Answer is
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: Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9 p.m. Design a…
A: given data Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9…
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: 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: Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9 p.m. Design a…
A: Program plan: Declare variables table_count and Prompt for the tableNumber, time, and persons…
Q: Q/Write a visual basic program to greneate the following numbers on listbox using do .. loop The…
A: Algorithm: Start Initialize x to 0, y and z to 40 Using do loop, iterate through the loop till…
Q: The snippet below displays line numbers off to the left to identify each line of the code. Use these…
A: The given code is 1 : int item; 2 : double itemCost; 3: double totalCost; 4 : for(item = 1; item…
Q: T/F 10) The expression int[ ] list = 5, 10, 15, 20; sets the number of int values in the sequence…
A: It is a type of list array:
Q: Q3/estimate the results when you execute the following code: x-1 Z=1 tl=x+y*z
A: Operators precedence: Highest: ^ Lower: *, /, % Lowest: +, -
Q: A mail-order house sells five products whose retail prices are as follows: Product 1, $2.98; product…
A: Note: Below is the required program in the C++ language. Programming Approach: Including necessary…
Q: A mail-order house sells five products whose retail prices are as follows: Product 1, $2.98; product…
A: Note: Programming language is missing in the question. So we will answer this program in C++…
Q: an azuenuI DUE UIEIãord after reading from a file “emp.txt". struct perSalary int month; /* number 1…
A: C code: /* C program for show employee data represented as structures */ /* include necessary…
Q: FILENAME: SURNAME_CONTROL STRUCTURES USING SWITCH-CASE Case Problem Ask the user to select an item…
A: Given: To implement a menu driven program. switch the item code and calculate and display details…
Q: Employee's first name: Kim Employee's last name: Smith Number of shifts: 25 Number of transactions:…
A: #include<iostream> #include<string> using namespace std; int main(){ // Declare and…
Q: Create a VB.NET Console Application that uses the While loop to display all leap years between 2010…
A: Actually, program is an executable software that runs on a computer.
Q: *11.15 (Area of a convex polygon) A polygon is convex if it contains any line segments that connects…
A: Program: /**ConvexPolygon.java**/ import java.util.Scanner; public class ConvexPolygon { public…
Q: Magic Number Programming: Magic program ask user to enter three integers by the user, the three…
A: # include<stdio.h> void magic(int left, int right, int digit) // the function to generate…
Q: sample output: Enter product number (1-5) (0 to stop): 1 Enter quantity sold: 5 Enter product…
A: import java.util.Scanner; public class Tester{ public static void main(String[] args) { Scanner…
Q: cout > studentname; cout > score; cout > totalpoints; count = count++; finalscore = score /…
A: Hey, thank you for your question. As per your question, we understand that your given code would…
Q: 2.26 (Multiples) Write an application that reads two integers, determines whether the first is a…
A: C++ Program for above : #include <iostream> using namespace std; int main() { //read…
Q: Le Chef Heureux Restaurant has 20 tables that can be reserved at 5 p.m., 7 p.m., or 9 p.m. Design a…
A: Actually, program is an executable software that runs on a computer.
Q: Magic Number Programming: Magic program ask user to enter three integers by the user, the three…
A: # include<stdio.h> void magic_numbers(int left, int right, int digit) // the function to…
Q: Create a VB.NET Console Application that uses the While loop to display all leap years between 2010…
A: Algorithm: 1. Start 2. Initilaize y to 2010 3. Using while loop traverse from 2010 to 2050 4. Inside…
Q: Return the index of the first integer in items that is less than its index, or -1 if no such integer…
A: Q. def small_index(items: list[int]) -> int:"""Return the index of the first integer in items…
Q: A mail-order house sells five products whose retail prices are as follows: Product 1, $2.98; product…
A: Programming language is missing in the question. So we will answer this program in C++ language. If…
Q: Question: Find the second largest number Code below: public static int findSecondLargest(List…
A: The question is to write the complete function for the given problem.
Q: Create a VB.NET Console Application that uses the While loop to display all leap years between 2010…
A: Visual Basic .NET is a multi-paradigm, object-oriented programming language, implemented on the .NET…
Q: R&R Travel and Tours offers special promotion flight fare from Kuala Lumpur to Kota Bharu on…
A: The program reads air code, category, and number of persons. These are should be in a while loop…
Q: Geometric Progression Printer As you might recall, a Geometric Progression (or GP) is a sequence of…
A: ALGORITHM:- 1. Take input for the a1, r and the number of terms to generate in the gp. 2. Print the…
Q: Geometric Progression Printer As you might recall, a Geometric Progression (or GP) is a sequence of…
A: Step-1: Start Step-2: Declare variable a1 and take input from user Step-3: Declare variable r and…
Q: An online retailer sells five products whose retail prices are as follows: Product 1, $2.98; product…
A: Q: Code the given problem. (Language used: C++)
Q: def display (): print ("ITSE101") def displayNumber (n1, n2): if nl > n2: return nl + n2 else:…
A: I have provided the comments to the given code and output.
Q: // EmployeeBonus.cpp - This program calculates an employee's yearly bonus. #include #include…
A: Code: #include <iostream>#include <string>using namespace std;int main() {…
Q: What will the following code display?total = 0for count in range(1, 6):total = total +…
A: Given: Output of Program
Q: I. Pay Increase (Nr 8, Page 357) At one college the compensation for a full-time teacher is $60,000…
A: FORM DESIGN:
Q: Computer Science Question LabThere is only one list of N ingredients in the menu. Every ingredient…
A: Below is the detailed python code for the given problem statement:
Q: R&R Travel and Tours offers special promotion flight fare from Kuala Lumpur to Kota Bharu on…
A:
Q: 5.21 (Pythagorean Triples) A right triangle can have sides whose lengths are all integers. The set…
A: Code: import java.io.*; import java.util.*; // Class for Pythagorean number table generation public…
Q: 3.3.2: Nested loops: Print seats. Given numRows and numColumns, print a list of all seats in a…
A: NOTE - I have used python programing language to solve the problem. Here I have taken input from the…
Q: This part is a game that the user can play. The game starts with the following screen in a table…
A: Answer: HTML, JQuery and CSS codes - Save this code as .HTML file and open with any browser…
Q: #include #include #include using namespace std; int main() { int monthlyUsage[12]; double…
A: Process Explanation : The above C++ code is used for calculating consumption of electricity in each…
Q: Write an application that allows a user to enter the names and birth dates of up to 10 friends.…
A: Note: Programming language is not mentioned in this question, so I am doing in C++ In this question,…
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
Rewrite the following if statements using the conditional operator:
Step by step
Solved in 2 steps with 2 images
- Javascript toggleCommentSection function The function toggleCommentSection should exist. The function toggleCommentSection should return undefined if not passed a parameter. The function toggleCommentSection should return null if passed a parameter that does not match a post ID. The function toggleCommentSection should select and return the correct section element. The function toggleCommentSection should toggle the 'hide' class on the section The following are requirements of the function toggleCommentSection: element.toggleCommentSection a. Receives a postId as the parameter b. Selects the section element with the data-post-id attribute equal to the postId received as a parameter c. Use code to verify the section exists before attempting to access the classList property d. At this point in your code, the section will not exist. You can create one to test if desired. e. Toggles the class 'hide' on the section element f. Return the section element Here is what I have so far:…CHALLENGE ACTIVITY using C++ 1.6.3: Total cost. A drink costs 2 dollars. A taco costs 4 dollars. Given the number of each, compute total cost and assign totalCost with the result. Ex: 4 drinks and 6 tacos yields totalCost of 32. #include <iostream>using namespace std; int main() { int numDrinks; int numTacos; int totalCost; cin >> numDrinks; cin >> numTacos; cin >>totalCost; cout << numDrinks * 2 + numTacos * 4; cout << "Total cost: " << totalCost << endl; return 0;}Write a statement to print the data members of InventoryTag. End with newline. Ex: if itemID is 314 and quantityRemaining is 500, print:Inventory ID: 314, Qty: 500 #include <iostream>using namespace std; struct InventoryTag { int itemID; int quantityRemaining;}; int main() { InventoryTag redSweater; cin >> redSweater.itemID; cin >> redSweater.quantityRemaining; /* Your solution goes here */ return 0;}
- Double any element's value that is less than controlValue. Ex: If controlValue = 10, then dataPoints = {2, 12, 9, 20} becomes {4, 12, 18, 20}. #include <iostream>using namespace std; int main() { const int NUM_POINTS = 4; int dataPoints[NUM_POINTS]; int controlValue; int i; cin >> controlValue; for (i = 0; i < NUM_POINTS; ++i) { cin >> dataPoints[i]; } /* Your solution goes here */ for (i = 0; i < NUM_POINTS; ++i) { cout << dataPoints[i] << " " ; } cout << endl; return 0;}create a prog that will compute the final grade for a certain student and will display the final grade and a remark if it is passed or failedPass = 75 aboveFailed = 74 belowCS= 60% quiz + 40 assignmentPG =[ 2(Pcs) + PE] / 3TMG = [2(Mcs) +ME] /3MG = [2(TMG) + PG] / 3TFG = Fcs +ME + SFEFG = [2(TFG) + MG ] / 3sample output:enter name of student: Cruzenter quiz Score: 75enter assignment Score: 75enter PE Score: 75PG of Cruz is : 75enter Mquiz Score: 75enter Massignment Score: 75enter ME Score: 75MG of Cruz is: 75enter Fquiz Score: 75enter Fassignment Score: 75enter SFE Score: 75enter FE Score: 75MG of Cruz is: 75FG of Cruz is : 75congrats you PASSDouble any element's value that is less than minValue. Ex: If minValue = 10, then dataPoints = {2, 12, 9, 20} becomes {4, 12, 18, 20}. #include <iostream>using namespace std; int main() {const int NUM_POINTS = 4;int dataPoints[NUM_POINTS];int minValue;int i; cin >> minValue; for (i = 0; i < NUM_POINTS; ++i) {cin >> dataPoints[i];} /* Your solution goes here */ for (i = 0; i < NUM_POINTS; ++i) {cout << dataPoints[i] << " " ;}cout << endl; return 0;} Please help me with this problem using c++.
- When the value of an item is dependent on other data and that item is not updated when the other data is changed, what has the value become? a. bitter b. stale c. asynchronous d. moldySimple Student Management System Build the following app using Python Tkinter library. Using this app, user can • add student information • view all students • search student(s) by name • remove student by id Add • First name, last name, date of birth cannot be blank while adding a specific student information. • However major can be blank, which gets set to "Undefined" if left out blank. • Student Id is automatically generated by the program (ex: 1001, 1002, 1003, 1004 ….) If the user keeps a mandatory field blank (ex: First name) and presses "Add Student" button, it displays the following message box: first name is required If the user successfully enters all the necessary information and presses the "Add Student" button, it displays the following confirmation message box: student added View All When the user presses the "View All" button, it displays all the student’s information (Id, First name, Last name, Date of birth, and Major) in a nice formatted way. Example below: • Must…Please answer the question below 18. Choose correct option _______ initializes a new instance of Line class. Border BorderProperty Surround Line()
- JAVASCRIPT addButtonListeners a. Selects all buttons nested inside the main element b. If buttons exist: c. Loop through the NodeList of buttons d. Gets the postId from button.dataset.postId e. Adds a click event listener to each button (reference addEventListener) f. The listener calls an anonymous function (see cheatsheet) g. Inside the anonymous function: the function toggleComments is called with the event and postId as parameters h. Return the button elements which were selected i. You may want to define an empty toggleComments function for now. Not all tests will pass for addButtonListeners until toggleComments exists. I recommend waiting on the logic inside the toggleComments function until we get there. */ function addButtonListeners(){ }START OF PLAY The player starts with 100 points. They have ten attempts (or rounds) to reach 500 points to win. Each round, the player "bets" some amount of points. See gameplay as follows: A HIGH/LOW ROUND (1) The player is shown an initial random card.Cards have a value from 2-14; however, these values are converted to a string as follows: 2-9 are converted to their string equivalent "2", "3", ... "9"10 is "T", 11 is "J", 12 is "Q", 13 is "K" and 14 is "A" (2) After the play sees the first card, they should guess if the next card will be higher (i.e., greater than the current card) or lower (i.e., a lower value than the first card).They will do this by inputting "H" or "L" (lowercase "h" and "l" will also be accepted as valid input). (3) After they input their "high" or "low" guess, the player bets a number of points that their guess will be right. The bet must be between 1 and the total amount of points the player has.1 (4) After the bet amount is entered, a second card will be…Monty Hall Problem – Coding Lab In this lab, you will write a code that simulates the Monty Hall Game Show. Thegame host gives the participant the choice of selecting one of three doors. Twodoors has a goat behind them and one door has a prize. The set of choices arerandomized each round. The participant needs to select the door with the prizebehind it. When the participant selects a door, the game host reveals a door with agoat behind it. The game host opens a door (different from the one selected by theparticipant) that has a goat behind it. The participant is then given the option tochange their choice. When you run your code, the code would display a message prompting the user toinput their door choice, labelled as 1, 2, and 3. Then the code will display a doornumber (different from the one the user picked) with a goat behind it and ask theuser if they would like to change their choice. The code then displays a message onwhether the user guessed the correct door. The game then…