Write pseudocode to print your Name and Matric ID. Then, request a user to invoke
Q: Write a C++ code segment using the DO-while loop to find the sum of the integers 55 through 99…
A: Start Initialize number to 55 and sum to 0 Add number to sum if number<=99 and increment number…
Q: Please answer the three questions!
A: 1) The statement for(;;) will run and will become an infinite loop.
Q: 1.Write a program that calculates and produces these two columns sequence numbers using the three…
A: 1) Below is C Program that calculates and produces these two columns sequence number using three…
Q: Procedure: Write a program to simulate a simple calculator to execute the operations: +, -, * , / ,…
A: Note: since your question contain multiple question but we can answer only one at a time. so, please…
Q: Which of the following Statement is NOT True? a)do-while loop will not execute at least once, if…
A: In choice a, it is wrong because it is an exit control loop that executes at least once when the…
Q: What type of loop statement should you use if the instructions in the loop body must be processed at…
A: In case of for loop and while loop first of all condition is checked if the condition is true then…
Q: 1-write a V.B program that contained two text box, the first text box using to inter the integer…
A: Initially we make a simple form in vb and write the code given below:…
Q: The program should display a diamond shape out of asterisks based on an input value provided by the…
A: Code:import java.util.*;class Pattern{ public static void print(int num, int i) { for(int…
Q: • Exercise 2: Write a script that print all even number from n1 to n2, n1 and 2 are provided by…
A: Given: To write C++ Code.
Q: Write visual Basic program to evaluate the following series. Use nested Do Loop While.
A: Algorithm: 1. Start 2. Declare sum variable 3. Using nested do while loop calculate the given series…
Q: 1-write a V.B program that contained two text box, the first text box using to inter the integer…
A: Answer:- a) Using for..next statement, See the code below in code window Public Class Form1 Dim…
Q: Write a program that prompts the user to input any digit then swap the position of the first and the…
A: Include the header file. Inside the main function take the input of the element. Take the first…
Q: Write a program that uses aa loop to display a table of the Celcius temperatures from 0 to 30 and…
A: #include<iostream> using namespace std; int main(){ //displaying the heading cout…
Q: b) Based on the code segment in Figure 2, revise the for loop statement to while loop statement. int…
A: #include<stdio.h> int main() // main function { int a, b;…
Q: Example: If n = 4, output ** ***
A: In this Programming question we have to determine code and output of pyramid pattern.
Q: Write a program that receives a series of numbers from the user and allows the user to press the…
A: programming language is not defined so we are providing code in python poseudo code set counter to 0…
Q: COUNTDOWN TO ZERO: 4 COUNTDOWN TO ZERO: 3 COUNTDOWN TO ZERO: 2 COUNTDOWN TO ZERO: 1 COUNTDOWN TO…
A: Algorithm:- Step1:- Start Step 2:- declare int n=4; step 3:- start a while loop and pass the…
Q: 3. Write a program which produces the given sequence numbers (in alternate arrangement ) using the…
A: The question is to write the C code for the given problem.
Q: Write a do while loop that uses the loop control variable to take on the values 0 through 10. In…
A: #include<iostream> using namespace std; int main(){ string head1 = "Number: "; string…
Q: Write a C++ code segment using the while loop to find the sum of the integers 55 through 99…
A: Required: c++
Q: 2- Write a V.B program that checks a group of numbers (1 to 10) if it's primary then print primary…
A: Given The answer is given below. Find an implementation below.
Q: Write a program that uses nested loops to print the output exactly as shown below. NOTE: You must…
A: #program to print given pattern using nested loop\#outer loop for:rows count, inner loop for :…
Q: Define the problem analysis and write the pseudo code and flowchart that will read a file of numbers…
A: The observe–orient–decide–act (OODA) loop was created by military strategist and United States Air…
Q: Draw the flowchart then write the C program that calculates the following summation using for loop…
A: FLOWCHART:
Q: Construct a do-while() loop in c, which continues to display the following menu: 1. Add funds to…
A: Following is the C program that displays the menu and prompt user to enter the choice. If the choice…
Q: Which of the folowing is correct for break statement in python? a. terminate the loop. b. Not jump…
A: Task :- Choose the correct option about break statement in python.
Q: 1. FizzBuzz by CodeChum Admin Let’s play a game of FizzBuzz! It’s quite the same with your…
A: Condition: Input a positive integer in one line. This will serve as the ending point of your loop.…
Q: Analyze the following code. int x = 1; while (0 < x) && (x < 100) System.out.printin(x++); O The…
A: Answer: The code does not compile because (0<x) && (x<100) is not enclosed in a pair…
Q: Write a program that receives a series of numbers from the user and allows the user to press the…
A: def main(): average = 0 sum_nums = 0 product = 1 nums = [] while True:…
Q: C. c. Add a ne
A: #include <iostream>using namespace std;int main(){ std::string food="pizza";//a food…
Q: You have to write menu driven programme which asks user to select a favorite color from the…
A: Step 1:- Program Approach:- 1.Declare the two variables of type integer and initialize the variable…
Q: B. Create an iteration program (Nested Loop) in C++ that display the output below: 4 3 2 1 4 3 2 4 3…
A: I can answer question number B.
Q: Which statement about counter variables used in program loops is correct? The counter variable…
A: The correct answer is
Q: i)Break and Continue ii)While and For Loop iii)if else and elif statement
A: Ans i) The main difference between break and continue is that break is used for immediate…
Q: Which of the below statements is correct? * A for loop is executed if the initial and last values…
A: Answer is B(A while loop is infinite if the loop condition is satisfied all the time.) we gave…
Q: In this lab, you use a counter-controlled while loop in a C++ program provided for you. When…
A: The code is given below:-
Q: Q1)Draw a flowchart for the following pseudocode: START Read and prompt quantity Read and prompt…
A: A flowchart is a type of diagram that represents a workflow or process. A flowchart can also be…
Q: you use a counter-controlled while loop in a C++ program provided for you. When completed, the…
A: I have given an answer in step 2.
Q: Write a postcondition, event-controlled loop (i.e., a while loop), using a flag variable, that…
A: PROGRAM STRUCTURE: Initialize the flag variable. Declare the loop variable to print the series.…
Q: The cout statement in the following program segment will display 9: z = 10; cout << --z;
A: Pre decrement operator is an operator which decreases the value by 1 and the value in the stack gets…
Q: Now, using your knowledge of loops, revise the program so that it contains no more than three output…
A: For each row n, you are having 2*n-1 T's which is preceded by 7-n spaces
Q: Q2: Write the code so that you can take input on the console and display each word in the next line.…
A: As no programming language is mentioned it is solved using basic python
Q: The main difference between using do/while loop and while loop is that while loop executes the code…
A: In OOP, the while loop and do-while loops are declared with the below syntax. While loop syntax…
Q: 1-write a VB program that contained two text box, the fırst text box using to inter the integer…
A: Private Sub Command1_Click() Dim n, f, i As Integer i = 0 f = 1 n = Val(Text1.Text) Do While i <…
Q: index = 1, 100, 2, is a valid loop statement
A: for loop in C/C++ for-loop, known as a counter-controlled loop, depicts that the number of…
Q: v Question Completion Status: QUESTION 2 x - 5 while(xc-4): print(x) x x + 1 print("While loop…
A: According to the question this program is not showing any output but if you compare grater value…
Q: Write a counter-controlled while loop that uses the loop control variable to take on the values 0…
A: #include<iostream> using namespace std; int main(){ string head1 = "Number: "; string…
Q: Q6:) Write a code program to draw the figure as shown below. Start from point A( 40, 60 ). Use form…
A: Answer:- The context.scale() method applies scale factors to the context's coordinate system, making…
Q: Write visual Basic program using Do Loop While to read 7 marks, if pass in all marks (>=50) print…
A: Programming instructions: Create required variables. In the Do loop while, take marks from the…
(a) Write pseudocode to print your Name and Matric ID. Then, request a user to invoke
selection number 1 to print the menu and triangle as shown in Figure Q4.
(6 marks)
(b) Write the C program that can print your Name, Matric ID and the triangle design.
Using a while loop, the program allows the user to repeat the process by invoking
letter ‘y’ and the process will be terminated when the user invokes any letter, except
letter ‘y’. The program consists of the following functions:
Main – call the other function to print messages. Then, prompt and ask user
to invoke number 1 to call other functions to print a triangle. Afterward,
prompt and ask user to invoke letter ‘y’ to repeat the process as shown in
Figure Q4.
print_menu – print messages including your Name and Matric ID as shown
in Figure Q4.
draw_triangle – print a triangle.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- AHPA #3: Ice Cream * * Bob’s Ice Cream sells four types of ice cream: vanilla, chocolate, * mint, and strawberry. * * Bob's Ice Cream sells ice cream from trucks that are parked at two * different corners. They sold {$11.5, $15.75, $22, $7.25} on Saturday * and {$12.75, $9.25, $16.5, $21} on Sunday [note sales are in vanilla, * chocolate, mint, and strawberry order]. * * Create an enum for flavors: enum flavors {vanilla, chocolate, mint, * strawberry}; * * Create a program that allows a user to enter the type of ice cream * sold. * * Create a program that allows a user to enter the sales data. * * Load two one-dimensional arrays with Bob’s entered sales data. Only * index your arrays using an enum variable (enum flavors index = * vanilla; corner1Sales[index] = 11.5;) * * Sum the contents of the flavors in the arrays together. * * Print out the resulting flavors and their sum with Bob's total sales. * please with commentAHPA #3: Ice Cream * * Bob’s Ice Cream sells four types of ice cream: vanilla, chocolate, * mint, and strawberry. * * Bob's Ice Cream sells ice cream from trucks that are parked at two * different corners. They sold {$11.5, $15.75, $22, $7.25} on Saturday * and {$12.75, $9.25, $16.5, $21} on Sunday [note sales are in vanilla, * chocolate, mint, and strawberry order]. * * Create an enum for flavors: enum flavors {vanilla, chocolate, mint, * strawberry}; * * Create a program that allows a user to enter the type of ice cream * sold. * * Create a C program that allows a user to enter the sales data. * * Load two one-dimensional arrays with Bob’s entered sales data. Only * index your arrays using an enum variable (enum flavors index = * vanilla; corner1Sales[index] = 11.5;) * * Sum the contents of the flavors in the arrays together. * * Print out the resulting flavors and their sum with Bob's total sales. * please with commentThe following program moves a robot in a grid of squares. The initial position and direction of the robot is shown below. Click on the grid to move the robot to the final position after the program is run. You must click within the box to rotate the robot to the correct final direction (click near the top of the box to rotate up, etc...) Feel free to move the robot along as you follow the code. PROCEDURE DoSomething(a){ MOVE_FORWARD() if( a > 2 ) { MOVE_FORWARD() } else { if( a = 3 ) { MOVE_FORWARD() } } MOVE_FORWARD()} i ⬅ 3ROTATE_RIGHT()REPEAT 2 TIMES{ DoSomething(i) MOVE_FORWARD() ROTATE_RIGHT() i ⬅ i - 1}
- Digital Trumpet Use an Arduino IDE to create a digital trumpet using Arduino Uno board the program should do the following (screenshot should be provided): Program Overview Check to see if the first button is pressed. a. If it is, play the frequency for c. b. If it isn’t, skip to the next else if statement. Check to see if the second button is pressed. a. If it is, play the frequency for e. b. If it isn’t, skip to the next else if statement. Check to see if the second button is pressed. a. If it is, play the frequency for g. b. If it isn’t, skip to the next else if statement. If none of the if statements are true a. Turn the buzzer off.Computer Science Using visual studio 2019 with a C# program create a WCF service to compute the body mass index (BMI) b. Let the user enter his or her weight w, in pounds and height, in inches. Then compute the body mass according to this formula and display the result. Let the user know if they have a healthy BMI or not. b=703w/h^2.Digital Trumpet Use an Arduino IDE to create a digital trumpet the program should do the following (screenshot should be provided): Program Overview Check to see if the first button is pressed. a. If it is, play the frequency for c. b. If it isn’t, skip to the next else if statement. Check to see if the second button is pressed. a. If it is, play the frequency for e. b. If it isn’t, skip to the next else if statement. Check to see if the second button is pressed. a. If it is, play the frequency for g. b. If it isn’t, skip to the next else if statement. If none of the if statements are true a. Turn the buzzer off.
- The screen size of a TV is given by the length of the rectangular diagonal. Traditional TVs come in 4:3 ratio, that is, the ratio of length to width is 4 to 3. This means, if the length is x inches, then the width is (3/4)x. LCD TVs come in 16:9 ratio. Instructions Write a program that: Prompts the user to input the length of the diagonal (in inches) of the screen Allows the user to select which type of TV the user would like to view the dimensions for Ex.1: Traditional TV area. 2: LCD TV Area 3: Both types of TVs area Have the program calculate and display the: Screen length Screen width Screen area for the specified type of TV.Create a non-screen receipt where the buyer can see the quantity, product name, unit price, and quantity*unit price of each item he bought. The receipt can also display the total amount he has bought.The user (the cashier) can only inputthe quantity of each product that the buyer/customerhas bought. **Assume that only 5 products are for sale. (C Language)Using visual studio or visual basic For 1-4, Using a For…Next, Do While, or Do Until Loops, create the following loops. Print all integer values from 0 to 10 Print all the odd numbers from 1 to 100 Print all the even numbers from 2 to 50 Print out every other odd number from 1 to a user specifiable upper limit (inclusive)
- Calculate the third side of right angle triangle i.e. Hypotenuse. Ask the value of perpendicular and base from user then calculate the hypotenuse of right angle triangle.Taking a Restaurant Order: Sentinel Style. Using the restaurant menu you selected in assigment below , you will create a program that will take an order from a customer and calculate the total. Your program shall, Display the menu with the prices. Take an order using the Sentinel approach in section 5.2.5 (atatched) The user will input numbers between 1 and 10, according to the menu you created below. Use zero as sentinel value (see Listing 5.5, p. 141) Inform the user about invalid input values (greater than 10 or less than 0) Add the prices of the dishes ordered After taking the order, the program displays the subtotal, the sales tax (8.75%), the grand total, and a suggested 15% tip. You can use the program you created below and modify to incorporate the new requirements. Notice that you will still need the multi-way conditional to add the right price value to the running total of the order. import sys #Enter number for each dish and price for users DishNumber=…Octave Program: Given the diagram above (image) and initial temperature of 60 degrees Fahrenheit, write an Octave program that allows a user to enter a final temperature and determine if contact will be made with the wall. The program will return one of the following: “WALL CONTACT” or “NO WALL CONTACT”