Find the error in each of the following program segments and explain how to correct it: double cube (float); a) cube (float number) return number * number * number; double y = 123.45678; int x; b) x = y; printf("%f\n", (double) x);
Q: A node in a binary tree can have more than one parent. True False
A: Introduction
Q: What is the distinction between uncertainty and risk?
A: Intro Risk and uncertainty are both associated with the project on which team is working.
Q: atn -3 2w b) x(t) 3. 1 -6 -3 -2 3 4 6 . kje
A: Matlab code for Fourier Seriesclear allclose all%Question a.%function for which Fourier series have ...
Q: Complete the program and identify and correct the errors in each of the following. While ( x <= 100 ...
A: while(x<=100) total = + x; ++x;1. In first Program there is while loop but no ope...
Q: What's the difference between a monospaced typeface and one that's proportionally spaced?
A: INTRODUCTION: In a proportional typeface, the width of each character is proportional to its height....
Q: A) convert (1.5,7pi/3) to rectangular.
A: The answer is as follows.
Q: Q4. Apply the dynamic programming which studies in the class to make change for an amount N=10 using...
A: Introduction: Here we are required to Find the minimum number of coins to make change for the given ...
Q: Question 2 ( Consider a 32-bit microprocessor that has an on-chip 16-kbytes four-way set-associative...
A:
Q: Which statement about the Find Replace tool is correct? A. A portion of a value can be replaced B. A...
A: Find replace tool used to find a string in one column of a dataset and look up and replace it with ...
Q: Assume having a narrow low-pass channel that spans from a Frequency of 0Hz to 5400HZ, and a digital ...
A: Here we calculate the minimum frequency required for analog by using the given information and fill ...
Q: 4. Design a program that takes 2 words as input and uses the ASCII code of the first letters of each...
A: Program - import java.util.Scanner; public class Main{ public static void main(String[] args) {// ...
Q: What's the difference between a monospaced typeface and one that's proportionally spaced?
A: The answer is given below.
Q: Which of the following can be used to represents the public members of a class in the class diagram?...
A: Answer is
Q: In BitTorrent, suppose Alice provides chunks to Bob throughout a 30-second interval Will Bob necessa...
A: The answer as given below:
Q: Suppose you are transferring 1000 from account A to B and the current balance of A is 3000 and B is...
A: Introduction Suppose you are transferring 1000 from account A to B and the current balance of A is...
Q: Program 2: Write a python program to accept the name, age and income of n employees. Find the tax on...
A: I give the code in Python along with output and code screenshot
Q: 8. A 10-bit counter, clocked with an input frequency of 512 kHz, runs continuously. Every time it ov...
A: here we calculate the frequency of interrupt stream by using the given information , so the calculat...
Q: What exactly do you mean when you say "network security"? Describe the functioning of the data encry...
A: Introduction: The term "network security" refers to a number of different strategies, tools, and pro...
Q: Write a program in java for the following scenario and write a DriverQ class to test your constructi...
A: Find the required code in java given as below and output :
Q: Discuss the five specific examples of fuzzy logic applications in artificial intelligence.
A: Given: We have to Discuss the five specific examples of fuzzy logic applications in artificial int...
Q: Tasks 2.1 From the story, find the title of the story which starts with "The" and ends with"-Mouse" ...
A: Regular expression: It is a string of letters that determines a text search pattern. String-searchin...
Q: Question: Write a Python program to Encrypt the message " MATHEMATICS" using Affine transformation.
A: # affine cipher encryption function# returns the cipher textdef affine_encrypt(text, key): retur...
Q: One of the primary concerns of risk management is asset valuation, which is the process of calculati...
A: Introduction Considerations for type of asset are important when talk of valuation. Both data an...
Q: Why does Ethernet put a constraint on the minimum frame length of data payload?
A: We need to explain why does Ethernet put a constraint on the minimum frame length of data payload. *...
Q: Void methods can accept arguments. O True O False
A: We are going to learn if void methods can accept arguments.
Q: When you open a photo and then resize the frame, what happens? What if you resize the frame first, t...
A: Image Processing:- Image Processing is defined as a technique in which we collect some information ...
Q: What constitutes a security problem in the case of extensions, plug-ins, and add-ons?
A: Introduction: The term "add-on" refers to a software utility or a hardware component that may be add...
Q: Describe benefits of REST over SOAP.
A: The answer is given below.
Q: How to encode a TM in b
A: Below to encode a TM in binary
Q: Outline the role, and implementation details, of a Sliding Window Detection based Convolutional Neur...
A:
Q: What exactly is personalization? What are some examples of tailored information services that did no...
A: Introduction: Personalization (often referred to as customization) is the process of adapting a serv...
Q: How essential is Network Topology as a Network Administrator?
A: Given Questions: As a network administrator, how important is network topology?
Q: ntifier for employees. nsider two cases: • Suppose that (firstName, last Nam mary key. • Suppose tha...
A:
Q: Give the declaration for two variables called count and distance. count is of type int and is initia...
A: In Step 2, I have provided answer with C++ Program---------
Q: Contrast Assembly with Machine Language. Talk about the I-type instruction format.
A: Introduction: Computer languages have progressed from Low-Level to High-Level Languages over time. O...
Q: Prove using natural deduction ¬p→q, p∨r, ¬(q∧r) Ⱶ (¬q∧p)∨(¬r∧p)
A: We are going to prove that ¬p→q, p∨r, ¬(q∧r) Ⱶ (¬q∧p)∨(¬r∧p) using natural deduction.
Q: What are the three generations of advancement in wireless security that have taken place throughout ...
A: Introduction: Since the early 1990s, wireless security methods have evolved to provide both increase...
Q: Describe benefits of REST over SOAP.
A: Ans : The benefits of REST over SOAP IS: 1) REST allows a best variety of data formats where as SOA...
Q: Design a program using a console application in java NetBeans, named studentMarksReport that will pr...
A: According to the information given:- We have to follow the instruction to get desired output.
Q: What does the following program print? 1 void *helper(void *arg) { 2 int *num = (int*) arg; 3 *num =...
A: According to the Question Below the solution:
Q: In your own words please describe what is The Abstract Data Type ?
A: Abstract Data type is a type for objects whose behaviour is defined by a set of value and a set of o...
Q: How to encode a TM in binary
A:
Q: p:I bought a lottery ticket this week. q:I won the million dollar jackpot on Friday. The proposition...
A: According to the question, we have to choose the correct option in given preposition. And we have gi...
Q: No code, draw a huffman tree for the following frequencies w -- 7 n -- 21 e -- 12 r-- 8 i -- 12...
A: We are going to design a Huffman tree for given frequencies.
Q: For an optimization problem which of the following is/are the property/properties that must hold for...
A: For an optimization problem for a greedy algorithm to work there are two conditions. 1. Greedy - cho...
Q: STACK 100Н CODE 1ον AX MOV BX, 00000 ADD AX, BX MOV BX, Ox3C
A: Below the assembly code
Q: The period of a pulse waveform measures four horizontal divisions on an oscilloscope. If the time ba...
A: Given: The period of a pulse waveform measures four horizontal divisions on an oscilloscope. If th...
Q: What are the measures that can be taken by individuals and organizations to minimize the invasion of...
A: INTRODUCTION: Here we need to tell the measures that can be taken by individuals and organizations t...
Q: 1- Write the "Matlab" program code from the keyboard that calculates the area of the triangle with t...
A: Solution 1:- MATLAB Code:- % Proceeding user input of the sides and the angleval = input('Enter valu...
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.
In C
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- 1.24 LAB: Expression for calories burned during workout The following equation estimates the average calories burned for a person when exercising, which is based on a scientific journal article (source): Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output the average calories burned for a person. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('Calories: {:.2f} calories'.format(calories)) Ex: If the input is: 49 155 148 60 then the output is: Calories: 736.21 calories1.22 LAB: Expression for calories burned during workout The following equation estimates the average calories burned for a person when exercising, which is based on a scientific journal article (source): Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output the average calories burned for a person. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('Calories: {:.2f} calories'.format(calories)) Ex: If the input is: 49 155 148 60 then the output is: Calories: 736.21 calories 247772.2002516.qx3zqy7 LAB ACTIVITY 1.22.1: LAB: Expression for calories burned during workout Enter program input (optional)1.22 LAB: Expression for calories burned during workout The following equation estimates the average calories burned for a person when exercising, which is based on a scientific journal article (source): Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output the average calories burned for a person. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('Calories: {:.2f} calories'.format(calories)) Ex: If the input is: 49 155 148 60 then the output is: Calories: 736.21 calories '''''Calories=((Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991)x Time / 8.368''''' age_years=float(input())weight_lbs=float(input())heart_rate=float(input())time_min=float(input()) calories = (( 49 * 0.2757) - (155 * 0.03295) + (148 * 1.0781) - 75.4991)…
- Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output the average calories burned for a person. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('Calories: {:.2f} calories'.format(calories)) Ex: If the input is: 49 155 148 60 then the output is: Calories: 736.21 calories ''' Calories = ((Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991) x Time / 8.368 ''' I have put in so many codes and nothing is right. I am going nuts. I use python coding, and this example is on Zybooks. One person answered but I tried and still no luck. I tried to edit it and still no luck. i don't understand what I am doing wrongCalories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output the average calories burned for a person. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:System.out.printf("%.2f", yourValue); Ex: If the input is: 49 155 148 60 the output is: Calories: 736.21 calories1.20 LAB: Expression for calories burned during workout The following equations estimate the calories burned when exercising (source): Women: Calories = ( (Age x 0.074) — (Weight x 0.05741) + (Heart Rate x 0.4472) — 20.4022 ) x Time / 4.184 Men: Calories = ( (Age x 0.2017) + (Weight x 0.09036) + (Heart Rate x 0.6309) — 55.0969 ) x Time / 4.184 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output calories burned for women and men. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('Men: {:.2f} calories'.format(calories_man))
- The following equation estimates the average calories burned for a person when exercising, which is based on a scientific journal article (source): Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output the average calories burned for a person. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('Calories: {:.2f} calories'.format(calories)) Ex: If the input is: 49 155 148 60 then the output is: Calories: 736.21 calories ''' Calories = ((Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991) x Time / 8.368 ''' ''' Type your code here. '''The following equation estimates the average calories burned for a person when exercising, which is based on a scientific journal article (source): Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output the average calories burned for a person. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print(f'calories: {calories:.2f} calories') Ex: If the input is: 49 155 148 60 then the output is: Calories: 736.21 caloriesThe following equation estimates the average calories burned for a person when exercising, which is based on a scientific journal article (source): Calories = ( (Age x 0.2757) + (Weight x 0.03295) + (Heart Rate x 1.0781) — 75.4991 ) x Time / 8.368 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output the average calories burned for a person. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print(f'Calories: {calories:.2f} calories')
- 1.31 LAB: Expression for calories burned during workout The following equations estimate the calories burned when exercising (source): Women: Calories = ( (Age x 0.074) — (Weight x 0.05741) + (Heart Rate x 0.4472) — 20.4022 ) x Time / 4.184 Men: Calories = ( (Age x 0.2017) + (Weight x 0.09036) + (Heart Rate x 0.6309) — 55.0969 ) x Time / 4.184 Write a program using inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output calories burned for women and men. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('Men: {:.2f} calories'.format(calories_man)) Ex: If the input is: 49 155 148 60 Then the output is: Women: 580.94 calories Men: 891.47 caloriesBlock wise explain the program given below. #include <stdio.h>int main() { float numbers[5]; int j, pctr=0, nctr=0; printf("\nInput the first number: "); scanf("%f", &numbers[0]); printf("\nInput the second number: "); scanf("%f", &numbers[1]); printf("\nInput the third number: "); scanf("%f", &numbers[2]); printf("\nInput the fourth number: "); scanf("%f", &numbers[3]); printf("\nInput the fifth number: "); scanf("%f", &numbers[4]); for(j = 0; j < 5; j++) { if(numbers[j] >= 0) { pctr++; } else if(numbers[j] < 0) { nctr++; } } printf("\nNumber of positive numbers: %d", pctr); printf("\nNumber of negative numbers: %d", nctr); printf("\n"); return 0;}5.20 LAB: Step counter A pedometer treats walking 2,000 steps as walking 1 mile. Write a program whose input is the number of steps, and whose output is the miles walked. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('{:.2f}'.format(your_value))