Make a C program that will ask for the length and width of a rectangle and display the perimeter. Ask the user to try again, if the answer yes, enter the length and width. If the answer is no, the program terminates. Hint: use a do-while loop. Output: Enter length: 2.3 Enter width: 4.5 Perimeter - 13.6000 Noud you like to try again? [y/n]: y Enter length: 7.1 Enter width: 2.5 Perimeter - 19.2000 Noud you like to try again? [y/n]: n Process exited after 17.4 seconds with return value 0 Press any key to continue
Q: has a transmission speed of 1010 bits/sec. It uses data packets of size 2000 bytes each. The efficie...
A: Lets see the solution.
Q: You are given a tree T with n vertices, rooted at vertex 1. Each vertex i has an associated value ai...
A: #include<bits/stdc++.h> using namespace std; #define V 4 void printSolution(int color[]); bool...
Q: When model-driven architectures are used, it is theoretically possible to produce working programs f...
A: To examine some of the present roadblocks to the creation of fully automated translation technologie...
Q: Explain what a terabyte is and how to use it.
A: Terabyte An terabyte is a unit of measurement for computer storage.
Q: arn about the benefits and drawbacks of batch and online data input approaches. A demonstration of s...
A: Intro Compare and contrast the benefits and drawbacks of batch versus online data input methods. The...
Q: Create a JavaScript Arrow function that meets the following requirements: _missingSpace(string) • ...
A: Introduction Create a JavaScript Arrow function that meets the following requirements: _missingSpa...
Q: Write the Java statement for the following. Declare an array of String named dbz allocating 4 eleme...
A: Dear learner , hope you are doing well , I will try my best to answer this question. Acc. to our co...
Q: You've been given the task of setting up a LAN for your workplace. a. As part of this arrangement, d...
A: Introduction: Novell's DOS, Windows, Mac, and OS/2 clients may connect to a TCP/IP network with this...
Q: Write a program that prints an nxn multiplication table, given a positive integer n. Input Each test...
A: Python Program: # Taking the number n as user inputn = int(input("Enter the number n: ")) # Display ...
Q: Create a function which multiplies its parameter by -1. What happens an unsigned value is passed as ...
A: I have provided solution for first question only! (BECAUSE OF BARTLEBY POLICY) I have provid...
Q: Create a Tribute Page about someone who has contributed to the field of technology and deploy the si...
A: A tribute page can be defined as a web page that highlights all the achievements of a person and als...
Q: Consider a rectangle with perimeter 28 (units) Let the width of the rectangle be w (units) and ler t...
A: Actually, given information regarding perimeter 28(units).
Q: Examine the pros and disadvantages of enterprise-based systems in terms of maximising the use of inf...
A: Introduction: ICT ICT is an abbreviation that signifies Information Communications Technology.ICT in...
Q: Expalin with an illustration What is the necessity for software engineering? Given its significance ...
A: Introduction: Developing, designing, implementing, maintaining, and retiring software are all part o...
Q: Create a class whose main() holds two integer variables. Assign values to the variables. Create two ...
A: Step 1 : Start Step 2 : Define a method main() and declare two integer variables a and b in it. Step...
Q: Write a V.B 6.0 project to view the time in Hour, min and see using three text boxes add another tex...
A: Answer:
Q: O1. Write a flowchart for multiplication of 10 positive numbers.
A: Find the required flowchart given as below :
Q: access advanced audit policy settings, what tool is used
A: A) Group Policy it is used to access advanced policy settings
Q: Write 3 paragraphs for each question 1. Compare and contrast the pros and cons of visualization. Con...
A: The Answer is
Q: Write the SQL command for the following statement based on the Figure 1. a) Drop the constraint Prop...
A: A.ALTER TABLE PropertyForRent DROP CONSTRAINT PropertyForRent_branchNo_fk; B.RENAME TABLE PropertyFo...
Q: Computer Science Please code in MatLab
A: Introduction Please code in MatLab
Q: When it comes to ICT students, what is the importance of learning PROGRAMMING?
A: Introduction : ICT : Information and communication technology (ICT) is an acronym for information an...
Q: Analyse in what respect are distributed computing systems better than parallel processing systems
A: Distributed computing is not quite the same as equal processing despite the fact that the standard i...
Q: What is the standard for processes used by expert witnesses who present evidence in federal court in...
A: The requirements for expert testimony: For a scientist's information to be permissible so under Frye...
Q:
A: Its a nice Work!!!!!
Q: 3. Once you get the uppercase equivalent, print this out.
A: #include <stdio.h>// Return type - int// Name - toupper// Parameter - one integer which repres...
Q: Give an example of when adaptors are typically required when systems are built by merging applicatio...
A: Whenever multiple application frameworks are joined for performing out the necessities of the client...
Q: Given an array of size n and an integer k. Find any subset of the array whose elements sum to k. Wri...
A: Program Explanation- Our role is to A list and an integer is sent to Subset. Make a new dictionary ...
Q: How much will the amount of sharing and synchronization contained in the workload employed affect th...
A: Benchmarking: When it comes to computing platforms, benchmarking is the area of research that entail...
Q: What is S3's Static Website Hosting
A: We need to explain what is S3's Static Website Hosting.
Q: Compare and contrast virtual memory and virtual machines concepts. What are the goals of each? What ...
A: Introduction: Comparison using definitions: The virtual memory / virtual memory is designed to show ...
Q: What are the societal contributions of this key technologies? -Cloud Computing and Big Data -Afti...
A: CLOUD COMPUTING AND BIG DATA “Cloud Computing is not only the future of computing but the present an...
Q: Write the proper method declaration/ method call for the following (Javaprogramming)
A: 1 ) public static CSIT(int i) { String s=Integer.toString(i) } __________________ 2 ) void CCMI...
Q: write VB 6.0 program to print ali, Date and time after each 3 sec and continue until stop the timer ...
A: Answer in step 2
Q: Distinguish the reasons why distributed software systems are more complex than centralized software ...
A: Introduction: Distributed systems are more complicated than single-processor systems. Complexity eme...
Q: JAVA programming question i will attach images of the ourQueue code and the main I have to do the ...
A: One loop that would result into the stack Stack containing all of the negative number at the bottom...
Q: 2. What are the steps in converting one number system to another?
A: Given: What are the steps in converting one number system to another?
Q: Explain concurrency and then discuss four design and management considerations that arise as a resul...
A: Concurrency: Concurrency means execution of multiple processes at same time. The running processess ...
Q: 04. Write the following equation as a C++ expression and state the order of evaluation: -b + vb2 – 4...
A: The answer is given below.
Q: order for wireless systems to be developed to enable the Internet of Things, explain why public-key ...
A: In order for wireless systems to be developed to enable the Internet of Things, explain why public-k...
Q: (c) Simplify the following regular expression whenever possible ((a+b)*a*)* . (d) Simplify the follo...
A: Here, we are going to simplify the given regular expressions using their properties.
Q: Suppose the variable x represents people and F(X): x is friendly T(x): x is tall A(X): x is angry Wr...
A: A) For some people we need to use existential quantifier. The FOL is :
Q: nge each of instance variables (mutator); • A method toString that converts a stu
A: The program is written in java.
Q: 17. Assume you use a redirect to send the output from a command to a file. How do you control whethe...
A: The answer of this question is as follows:
Q: Why is making a lot of modifications to a packaged system sometimes a risky approach, and what are t...
A: a. A packaged system comes with all sorts of in-built functions or default functions.And if we make ...
Q: Create a definition for magnetic disk.
A: According to the question the magnetic disk are important for record the data and save it on the tra...
Q: What is the hexadecimal value of ECX?
A: what is hex code for ECX?
Q: ation may be inputted directly into the system, saving time by eliminating the need for an intermedi...
A: Lets see the solution.
Q: Create a JavaScript function expression that meets the following requirements: _spellCorrection( s...
A: Actually, program is an executable software that runs on a computer.
Q: Explain why the ability to respond in real time is a crucial differentiator between embedded systems...
A: Introduction: An embedded system is one that is embedded inside another system, normally performs a ...
c program loop
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Write a while loop that repeats while user_num ≥ 1. In each loop iteration, divide user_num by 2, then print user_num.Sample output with input: 2010.0 5.0 2.5 1.25 0.625 Note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds and report "Program end never reached." The system doesn't print the test case that caused the reported message. user_num = int(input()) print("enter the number ",end=" ")userNum=float(input())while(userNum >= 1): userNum = userNum / 2; print(userNum,end=" "); it is not working? still need helpWrite a complete program that: 1. Uses a do...while loop to prompt the user to enter a count that is greater than 1 and less than or equal to 20 then reads in a count from the keyboard as an integer. a. If input error occurs or the count the user enters is less than or equal to 1 or greater than 20, output an error. After outputting an error, clear/ignore the failed input and continue do...while looping until a valid number is entered. 2. Writes a triangle to the display using for loops. The triangle will be upside down. To write this triangle to the display: amountOfStars = number entered in (1). a. b. Output amountOfStars followed by a new line. C. Decrement amountOfStars by one. d. Continue from (b) until amountOfStars is zero. 3. Writes a triangle to the display using while loops. The triangle will be rightside up. To write this triangle to the display: a. amountOfStars = 1. b. Output amountOfStars followed by a new line. C. Increment amountOfStars by one. d. Continue from (b)…In python, write a program that asks the user for a positive integer value. The program should then use a while loop to compute the sum 1 + 1/2 + 1/3 + ... etc., where the number of terms is determined by the inputted integer, and output the result. For example, if the user enters 5, the loop will find the result of evaluating 1 + 1/2 + 1/3 + 1/4 + 1/5. If the user enters a negative number, the program should re-ask until it receives a non-negative number.
- Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space. Example output for userNum = 40: 20 10 5 2 1 Note: These activities may test code with different test values. This activity will perform four tests, with userNum = 40, then with userNum = 2, then with userNum = 0, then with userNum = -1. See "How to Use zyBooks". Also note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message. 367012.2549490.qx3zqy7 1 import java.util.Scanner; 3 public class DivideByTwoLoop { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); int userNum; 4 6. 7 8 userNum = scnr.nextInt(); 9. 10 V* Your solution goes here */ 11 12 System.out.println(""); } 13 14 }Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space. Example output for userNum = 40:20 10 5 2 1 Note: These activities may test code with different test values. This activity will perform four tests, with userNum = 40, then with userNum = 2, then with userNum = 0, then with userNum = -1. See "How to Use zyBooks".Also note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message.Write a program that calculates the balance of a savings account at the end of a period of time. It should ask the user for the annual interest rate, the starting balance, and the number of months that have passed since the account was established. A loop should then iterate once for every month, performing the following: A) Ask the user for the amount deposited into the account during the month. (Do not accept negative numbers.) This amount should be added to the balance. B) Ask the user for the amount withdrawn from the account during the month. (Do not accept negative numbers.) This amount should be subtracted from the balance. C) Calculate the monthly interest. The monthly interest rate is the annual interest rate divided by twelve. Multiply the monthly interest rate by the balance, and add the result to the balance. After the last iteration, the program should display the ending balance, the total amount of deposits, the total amount of withdrawals, and the total interest earned.
- Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space. Example output for userNum = 40: 20 10 5 2 1 Note: These activities may test code with different test values. This activity will perform four tests, with userNum = 40, then with userNum = 2, then with userNum = 0, then with userNum = -1. See "How to Use zyBooks". Also note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message. 367012.2549490.qx3zqy7 1 import java.util.Scanner; 2 3 public class DivideByTwoLoop { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); int userNum; 4 7 8 userNum scnr.nextInt(); 9. 10 * Your solution goes here 11 System.out.println(""); } 12 13 14 }Write a program that uses a while loop to enter any number of positive integers. When the loop ends, the program should report the totals of both the even and odd integers. I can't seem to figure out what is wrong with my code.. it is supposed to be the totals of even and odd so evens should be added up and should odds. even_sum = 0odd_sum = 0while(True): num = int(input('Enter Positive interger or Enter 0 to quit: '))#prompt user for positive intergerif(num == 0):breakelif(num%2 == 0):even= even_sum + numelse:odd= odd_sum + numprint(f'The evens total {even} and the odds total {odd}') #DIsplay number of evens and odd numbersProgramming in c++(visual studio 2019): I’m prompting the user to input “even odd or random” to start my code and noticed the while loop I use to check of the user input is valid or not freaks out if I go over the char limit I gave the user input. Can I fix this or do I just need to increase the input size?
- Consider the following for loop. int j, s;s = 0;for (j = 1; j <= 10; j++)s = s + j * (j - 1);In this for loop, identify the loop control variable, the initialization statement, loop condition, the update statement, and the statement that updates the value of s.Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. After the loop terminates, it prints out the sum of all the even integers read and the sum of all the odd integers read. Declare any variables that are needed. In C Programming.I have a Python programming question: Write a program that prints all the even numbers divisible by 3 but not divisible by 7 between 1 and 200. Use while loop with continue statement. When the even number is divisible by 3 but not 7 continue statement should allow you to go into the next iteration of the loop without printing the number.Output:6 12 18 24 30 36 48 54 60 66 72 78 90 96 102 108 114 120 132 138 144 150 156 162 174 180 186 192 198