Choose all the correct options from the choices given below: What does this program do? a=3 b=10 c=pow(b,2) d=pow(2,a) a. Calculates square of 10 and cube of 2 b. Calculates square of 2 and cube of 10 c. None of the above d. Calculates square of a and cube of b
Q: Choose all the correct options from the choices given below: What does this program do? a=3 b=10…
A: The preprocessor #include<cmath> has various functions that compute and transform the…
Q: 01: Draw a flowchart for work the traffic lights ? Q2: Write the algorithm required to find the…
A: Q1 flowchart is as given below :
Q: QI/ choose one of the questions- • a-Evaluate each of the following expressions, assuming in each…
A: A) a. m-8-n => 40-8-12 => 20 b. m=n=9 Here m and n will be assigned value 9 c. m%n =>…
Q: The problem is not the lower and upper case the problem is the quotation marks. The sentence,…
A: - The question is to read the string with the quotes and print accordingly with the quotes. - We…
Q: The following words have three consecutive letters that are also consecutive letters in the…
A: Program to find the three consecutive letters which also in consecutive alphabetical order from a…
Q: The following table shows the rate of commission that will be paid to the salesman according to the…
A: PROGRAM STRUCTURE: Include the required header files. Start the definition of the main function.…
Q: Read and understand the following problem: 1. Write a program that accepts from the user an…
A: Suppose the user entered 100 Peso. Given: 1 HK dollar = Php 6.51 ⇒ 1 Php = 1/6.51 HK dollar…
Q: by using c++ solve following questions. 1. Write a program that inputs salary and grade, It adds…
A: Here, you need to take input from user for salary and grade. So to store input values, you need to…
Q: A student took four quizzes in a term and would like to compute their average. He also would like to…
A: Hi Student. Warm welcome from my side. Hope you are doing good. Since You have not mentioned any…
Q: Write an algorithm and draw a flow chart , and write Code in visual basic (using IF Block…
A: Answer:
Q: What answers do you get for below queries for given program. Program : vegetarian(jose).…
A: As i have read Bartleby guidlines i can provide answer of only 1 part of questions in case of…
Q: The program below simulates tossing a fair coin N times. The program computes the longest sequence…
A: Let's see step by step: 1. const int HEADS = 0; const int TAILS = 1; here HEADS is initialized…
Q: Create a new version of the program below that uses Boolean expressions for making the required…
A: def valid_triangle(a,b,c): if a+b>=c and b+c>=a and c+a>=b: return True else:…
Q: (C PROGRAMMING ONLY) 7. Cornered! by CodeChum Admin Attention again soldier! Our men have been…
A: Find the required code in C given as below and output :
Q: Convert the following mathematical notation into programming notation, assume that you have already…
A: Mathematical Expression: It consists of numerical values, variables, operators, functions, and…
Q: Professor Chang wants a program that calculates and displays the area of a circle, given the…
A: Start Input Radius Calculate Area=3.14*radius*radius Print Area Stop
Q: 2. Måke &-NFA för the föllowing RE: (a ba) ? a (6 | ab)
A: e-nfa for the following RE: (a|ba)?a(b|ab)* is :
Q: mm yes program.py > fype your answer to "Summarise hair and eyes" here.
A: Lets see the solution in the next steps
Q: The population of town A is less than the population of town B. However, the population of town A is…
A: Program approach: Create the main function. Declare variables of int type. Prompts the user to…
Q: Explain the flow of this program ? def new_game(): guesses = [] correct_guesses = 0…
A: The given code is a quiz application where the program displays 4 questions one by one with its…
Q: 3. Given the values of three variables a = 2, b = 4, c = 7, write a program to (1) Calculate the sum…
A: I will provide the answer of this question in C++ programming language.
Q: 9. Write a program that inputs two real numbers then exchanges their values. 10. Make a program that…
A: To write a program for the following to input two real numbers then exchange their values. to…
Q: Choose all the correct options from the choices given below: What does this program do? a=3 b=10…
A: a =3 b = 10 c = pow(b,2) #102 d = pow(2,a) #23
Q: Which of the following solves the given problem? Problem: Create a program that will determine if…
A: Required: Problem: Create a program that will determine if an input character is a number, a letter,…
Q: Read your name and one numeric value [Omani Rial], print the following menu as shown in below…
A: Please find the answer below
Q: # Complete the following program num_in_tens = int(input('Enter the tens digit:\n')) num_in_ones =…
A: num_in_tens = int(input('Enter the tens digit:\n'))num_in_ones = int(input('Enter the ones…
Q: 1. If a=1, b=2, and c=3, what are the values of a, b and c at the end of the following program…
A: As per our guidelines we are supposed to answer only one question. Kindly repost other questions as…
Q: (c program only) 2. Jack `N Poy by CodeChum Admin Jack `N Poy is a very common game since our…
A: Code: #include <math.h>#include <stdio.h>#include <stdlib.h>#include…
Q: Finish the program to compute how many gallons of paint are needed to cover the given square feet of…
A: I have given the code below.
Q: Enter number of month M (1 January,..., 12 December): 6 Enter number of day D: 30 The zodiac sign is…
A: Here is the approach : Take input for the date and month Create the function to get the number of…
Q: 1-What will be the output of this program: a = [pi: pi/2: 4*pi]; m = 3* cos(a); Your answer
A:
Q: C program based on the algorithm below Welcome to the temperature conversion program. Please…
A: PROGRAM: //Header files #include <string.h> #include <stdio.h> //Defining the main int…
Q: This program accepts the height of a person in centimeter and categorise the person according * .to…
A: A. 1-ElseIf((p >= 150) And (p < 165)) Then 2-ElseIf((p >= 165) And (p <= 195)) Then…
Q: Finish the program to compute how many gallons of paint are needed to cover the given square feet of…
A: Algorithm Start Var area, c Accept input from user in variable area c = area/350 Print ("# of…
Q: When Jacob Steinberg began his trip from California to Vermont, he filled his car’s tank with gas…
A: This program is used to calculate and find the car's gas mileage at any time. We know the formula to…
Q: Q3a) Summary Newton’s law states that the force, F, between two bodies of masses M1 and M2 is given…
A: Note: since programming language is not mentioned we are providing solution in c++. Part a)…
Q: Given the coordinates (x, y) of a center of a circle and its radius, write a program which will…
A:
Q: decrease each of the next month’s bills by 10%. The city also levies a 3%utility tax, which is to…
A: Given: electricity cost per kilo watt is : 25.50Â utility tax is 3 % cost per kilo wat = 25.50 Â…
Q: Choose all the correct options from the choices given below: What does this program do? a=3 b=10…
A: Code: #include <iostream>#include<cmath>using namespace std;int main(){ int a=3;…
Q: Q3: ANSWER THE FOLLOWING. (** A: Write differences between input box and message box? B: Write a…
A: First of all, What is Visual Basic? It is a Computer programming language which is created by…
Q: Create a new version of the program below that uses Boolean expressions (not true of false) for…
A: A boolean expression is an expression that yields just the two outcomes: true or false. To relate…
Q: Wilma Peterson is paid by the hour. She would like a program that calculates and displays her weekly…
A: NOTE: - Below explanation is in visual basic. Output: - weekly gross pay Input: - hourly pay, total…
Q: es. Based on this input, the program computes and displays the ma ed by the projectile and the time…
A: C# code:
Q: Take user input for a sentence (character by character) and count total number of vowels both…
A: Input character by character into a string till user moves to new line Compare each character and…
Q: Q3: ANSWER THE FOLLOWING. (* A: Write differences between input box and message box? B: Write a…
A: According to the information given:- We have to write the difference between input box and message…
Q: What does the following code display? boolean p = if(!p) System.out.print("A"); else true, q =…
A: The answer is: B. B code: public class MyClass { public static void main(String args[]) {…
Q: speed=input("Enter your speed in mph: ") speed = int(speed) distance = input("Enter your distance in…
A:
Q: A. Prompts the user to enter the total amount of milk (in liters) produced in the morning. B.…
A: Code implementation: import java.util.Scanner;public class Main { public static void main(String…
Q: rite a program that prompts the user to enter:
A: Approach Use a do-while loop within if statement calculate the population of town A…
Step by step
Solved in 3 steps with 1 images
- Create a new version of the program below that uses Boolean expressions for making the required decisions. Simplify the selection statements as much as possible. # Entering the sides of triangle a = int(input("Enter the length of first side :"))b = int(input("Enter the length of second side :"))c = int(input("Enter the length of third side :")) # CHECKING WHETHER TRIANGLE IS VALID OR NOT if(a + b >= c): if(a + c >= b): if(b + c >= a): print("Triangle is Valid") print("Perimeter is:",a+b+c) else: print("Triangle is Invalid")When Jacob Steinberg began his trip from California to Vermont, he filled his car’s tank with gas and reset its trip meter to 0. After traveling 324 miles, Jacob stopped at a gas station to refuel; the gas tank required 17 gallons. Jacob wants a program that calculates and displays his car’s gas mileage at any time during the trip. The gas mileage is the number of miles his car can be driven per gallon of gas. Desk-check your solution’s algorithm using 324 as the number of miles driven and 17 as the number of gallons used; then desk-check it using 280 and 15.Create a new version of the program below that uses Boolean expressions (not true of false) for making the required decisions. Simplify the selection statements as much as possible. # Entering the sides of triangle a = int(input("Enter the length of first side :"))b = int(input("Enter the length of second side :"))c = int(input("Enter the length of third side :")) # CHECKING WHETHER TRIANGLE IS VALID OR NOT if(a + b >= c): if(a + c >= b): if(b + c >= a): print("Triangle is Valid") print("Perimeter is:",a+b+c) else: print("Triangle is Invalid") OUTPUT HAS TO BE Enter three edges: 1,1,1 The perimeter is 3 Enter three edges:1,3,1 The input is invalid
- The program shall be solved either by using if else ladder or switch only. No marks will be awarded if the problem is solved using any other technique. Problem: Read your name and one numeric value [Omani Rial], print the following menu as shown in below output, read user choice. Find and print equivalent currency value. Formulas: 1 Omani Rial = 2.60 US Dollars 1 Omani Rial = 2.18 Euros 1 Omani Rial = 1.86 British pounds 1 Omani Rial = 9.55 UAE DirhamsDriving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output the gas cost for 10 miles, 50 miles, and 400 miles.For below facts, rules, and goals write English Meanings. (1) color(carrots, orange). (2) likes(Person, carrots):-vegetarian(Person). (3) pass(Student) :- study_hard(Student). (4) ?- pass(Who). (5) ?- teaches(professor, Course). (6) enemies(X, Y) :- hates(X, Y), fights(X, Y). What answers do you get for below queries for given program.Program : vegetarian(jose). vegetarian(james). vegetable(carrot). vegetable(egg_plant). likes(jose, X) :- vegetable(X). loves(Who, egg_plant) :- vegetarian(Who).Queries : ?- vegetable(X). ?- vegetable(potato). ?- vegetarian(_). ?- likes(jose, What). ?- likes(Who, egg_plant). ?- loves(Who, egg_plant)
- the electrical resistance r (in ohms) of a metal wire is given by the formula r = (ml)/ a where m is the resistivity of the metal; l is the lenght of the wire in feer, and a is the cross-sectional area of the wire ( in the circular mils) write a program that allow user to input for l and a for a copper whose resistivity m of copper is 10.4. Calculte the resistance of a wireThe manager of Mama Calari’s Pizza Palace wants a program that calculates and displays the number of pizza slices into which a circular pizza can be divided. The manager will enter the radius of the entire pizza. For this exercise, use 14.13 as the area of a pizza slice, and use 3.14 as the value of pi. Desk-check your solution’s algorithm using 10 as the pizza’s radius; then desk-check it using 8. (Hint: For the first desk-check, the number of pizza slices should be a little over 22.)Q3) Write a program which input radius of circle and compute area of it. Then input the length of side of square and compute area of it, Then Print the largest area. Cirele Area = 0.5 R*3.14 Square Area = the length of side 4
- The following words have three consecutive letters that are also consecutive letters in the alphabet: THIRSTY, NOPE, AFGHANISTAN, STUDENT. Write a program that accepts a word as input and determines whether or not it has three consecutive letters that are also consecutive letters in the alphabet.The program below simulates tossing a fair coin N times. The program computes the longest sequence of consecutive heads. Or it should compute the longest sequence of consecutive heads. It does not compute the longest sequence of consecutive because one statement is missing and one statement is in the wrong place in the program. Supply the missing statement and move the out of place statement to the right position in the program. If you toss the coin a hundred times the longest sequence of consecutive heads is usually 5 or 6. #include <ctime>#include <iostream>#include <random>#include <string>using namespace std; int main(){ const int HEADS = 0; const int TAILS = 1; int seed = (int)time(nullptr); default_random_engine e(seed); uniform_int_distribution<int> u(HEADS, TAILS); int prevCoin = -1; int N = 100; int maxlength = 0; int length = 0; for (int n = 1; n <= N; ++n) { if (coin == HEADS) { if…Wilma Peterson is paid by the hour. She would like a program that calculates and displays her weekly gross pay. For this exercise, you do not need to worry about overtime pay, as Wilma never works more than 40 hours in a week. Desk-check your solution’s algorithm using $10 as the hourly pay and 35 as the number of hours worked; then desk-check it using $15 and 25.