Write a program using a codeblock that consists of the following algorithm: num1 =4, num2= 4* 5-11, sale = 0.02 * 1000, first =‘D’, str = “It is a sunny day”. .Your program has to display the results for num1, num2, sale, first and str
Q: Write a program that will determine if a number is positive or negative. If positive it should be…
A: Given: Write a program that will determine if a number is positive or negative. If positive it…
Q: Write a program that computes the molecular weight of a carbohydrate (ingrams per mole) based on the…
A: Given: Write a program that computes the molecular weight of a carbohydrate (ingrams per mole) based…
Q: Write a program that does the following: 1. prompts the user to enter a word 2. using that word,…
A: To Do: To write the C++ Code.
Q: 4. Before you can cross a bridge with your car, it must weigh within +/- 100 pounds of 1 ton For…
A: Hey, since multiple questions posted, we will answer first question according to our policy. If you…
Q: Write a program that reads from the user a character ('q' or 'c'). • i the character is 'c', the…
A: Since the programming language is not mentioned, we'll do it in python. The programming methodology…
Q: Write a program to display fruit sales receipts. Python language only Apple: Pink Lady -…
A: type1 = input("Which kind of apples would you like: (P)ink Lady 4.99/kilo (F)uji 5.99/kilo: ")qt1 =…
Q: A positive whole number n>2 is prime if no number between 2 and sqrt(n)(inclusive) evenly divides n.…
A: Python program: #taking a input for nn = int(input('enter the value of n:')) is_prime = True…
Q: a nonpalindromic prime number whose reversal is also a prime. For example, 17 is a prime, and 71 is…
A: We will define two function isPrime() to check a number is prime or not and another function called…
Q: A factorial of N is defined as 1 if N is O or 1, and 1*2**N if N is a non-negative integer. Write a…
A: note:- only one program will be solved if they are not linked . Also mention programming language…
Q: "QUICK-BASIC64 Write an algorithm that finds and prints the sum of the first N terms of the series…
A: CLS A = 1 INPUT "ENTER NUMBER OF TIMES THE SERIES WILL RUN="; N FOR I = 1 TO N PRINT A; A = A +3…
Q: Exercise 1: Ask the user to type a string. Count and display the number of vowels (a,e,i,o,u). Print…
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it in…
Q: Write a program that asks user to enter a number until user enters -1. Then the program should…
A: Here, Code instructions are given.
Q: Homework01. Write a Java program that prompts the user to enter the seconds as a String (e.g.,…
A: - The question is to complete the conversion.
Q: Suppose that the first number of a sequence is x, where x is a non-zero positive integer. We define…
A: Program in C++ to print sequence of number for the case defined in the statement above
Q: THIS IS MEANT TO BE IN JAVA Mad Libs are activities that have a person provide various words, which…
A: Solution: Given, Write a program that takes a string and an integer as input, and outputs a…
Q: Given the value of n from the user, write a program that will display the first n even numbers. Ex.…
A: Programming approach:- Using the necessary header file. Using namespace standard input/output.…
Q: Sometimes a company will use telephone numbers like 757-GET-FOOD to make the numbers easier to…
A: A = B = C = 2D = E = F = 3G = H = I = 4 J = K = L = 5 M = N = O = 6 P = Q = R = S = 7 T = U = V = 8…
Q: Write a program that does the following: 1. prompts the user to enter a word 2. using that word,…
A: Code: Output:
Q: Exercise 30 defines the number e and Exercise 31 shows how to approximate the value of e using a…
A: Since no programming language is mentioned. I am attempting this in python. if you need it in any…
Q: Write a program that computes the fuel efficiency for a multi-leg journey. The program will first…
A: Code To Copy: #Define the main() function. def main(): #Prompt the user to enter the…
Q: Given a positive integer n, the following rules will always create a sequence that ends with 1,…
A: 1)Read the n value using int(input()) function 2)print n value 3)repeat while until n!=1 4)…
Q: C++ Write a program that takes in a line of text as input, and outputs that line of text in…
A: Program approach: Including header files Starting the main function Initializing string variables,…
Q: Prompt the user for a string that contains two strings separated by a comma. Examples of strings…
A: import java.util.Arrays;import java.util.List;import java.util.Scanner;import…
Q: Suppose that the first number of a sequence is x, where x is a non-zero positive integer. We define…
A: #include <iostream>using namespace std; int main(){ char hims; do{ cout…
Q: (b) In a crypto-arithmetic puzzle, a mathematical equation is written using letters. Each letter can…
A: Python Program: From itertools import combinations, permutations x = input("Enter the value of x: ")…
Q: Given a positive integer n, the following rules will always create a sequence that ends with 1,…
A: As per the requirement program is developed. Note: Here in the question programming language is not…
Q: A prime number is called a Mersenne prime if it can be writtenin the form 2 p - 1 for some positive…
A: Since the programming language is not mentioned, assuming the programming language to be C language.
Q: Write a program that consists of the following algorithm: num1 =4, num2= 4* 5-11, sale = 0.02 *…
A: Write a program that consists of the following algorithm: num1 =4, num2= 4* 5-11, sale = 0.02 *…
Q: In Python Write a program that computes the fuel efficiency for a multi-leg journey. The program…
A: def main(): #Prompt the user to enter the input. start_odo = float(input("Enter the initial…
Q: Write a program that asks the user to enter the three sides (a, b and c) of a triangle as double…
A: Since no programming language was mentioned in the question, I have used C language to solve.
Q: Write a Java program that asks the user for three integer values and displays them sorted in…
A: Lets see the code in the next step
Q: Write a program that reads from the user a character ('q' or 'c'). If the character is 'c', the…
A: Note: As the programming language is not mentioned, program is written in c++ ALGORITHM Step 1:…
Q: A. Sum of Others: Write a program called sum_of_others.py Given three numbers x, y, z, determine if…
A: Steps in program: Take x, y, z as input Check using if-elif-else statement whether any two are sum…
Q: Develop a program in java that aids in the creation of non-empty palindromes i.e. an algorithm that…
A: Java program is given below to print all pre set number of palindromes
Q: PYTHON PROGRAMMING !)Write a program to display all the numbers which are divisible by 13 but…
A: As per guidelines we are supposed to answer only one question. Kindly repost other questions as a…
Q: Write this program with Python. Ask the user to enter a month with Zeller’s Algorithm, in text (e.g.…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: 1. Write a program that computes the area of each color in an archery target. For simplicity, we…
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it in…
Q: Each year the Department of Traffic Accidents receives accident count reports from a number of…
A: Algorithm: Start Implement read_Count() which takes a pointer to an array and its size as arguments…
Q: 7. Write a program that consists of the following algorithm: num1 =4, num2= 4* 5-11, sale = 0.02 *…
A: NOTE :- As per our Guidelines we only give one question solution at a time. Answer :- ( 7 ).…
Q: Write Psuedo-code of an algorithm that will repeatedly ask the user to enter a number 10 times. If…
A: Psuedo code is step by step written outline that can be easily translated into the program.
Q: (1) Prompt the user for a string that contains two strings separated by a comma. • Examples of…
A: Hello Student. Greetings Hope you are doing great I will try my best to answer your question.…
Q: Write a program that reads from the user a character ('q' or 'c'). if the character is 'c', the…
A: Java Program for above : import java.util.Scanner; class Prog{ public static void main…
Q: Write a program that does the following: 1. prompts the user to enter a word 2. using that word,…
A: Here I have taken input from the user and stored it into a variable of type string. Next, I have…
Q: The ancient Greeks classified numbers geometrically. For example, a number was called "triangular"…
A: Sample Response: // C++ program to check whether a number is a triangular number or not by using…
Q: Write a program that reads in a five-digit integer and determines whether it is a palindrome
A: EXPLANATION - A program is created . A number is declared named as n and taken as an input from…
Q: diagram last two digits of your student number (For example, if your student number is 1910602041,…
A: Here value of n is 34 So T = 34%25 = 1 i=2 j=0 i<9 -> True j=2 j<10 -> True T= T+j+i =…
Q: 1. Write a program that computes the area of each color in an archery target. For simplicity, we…
A: ANSWER:-
Q: A county collects property taxes on the assessed value of property, which is 60 percent of its…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: Complete the following program that collects an input word from the keyboard and finds if the word…
A: PROGRAM CODE: word = input("Enter a word: ") // take the word from the…
Q: a) Write a program that defines variables a, b, c, d as float and Num2 as integer. Solve the…
A: The program is a simple arithmetic operation using variables and different data types. Variables…
Write a program using a codeblock that consists of the following
Step by step
Solved in 2 steps with 2 images
- Write a program that inserts parentheses, a space, and a dash into a string of 10 user-entered numbers to format it as a phone number. For example, 5153458912 becomes (515) 345-8912. If the user does not enter exactly 10 digits, display an error message. Continue to accept user input until the user enters 999.Write a program that consists of the following algorithm: num1 =4, num2= 4* 5-11, sale = 0.02 * 1000, first =‘D’, str = “It is a sunny day”. .Your program has to display the results for num1, num2, sale, first and string.Write a program that asks the user to enter 2 integers of 4 digits and displays thedifferent digits as X and * if they are the same. If the user enters a number which is notof four digits, then a convenient message is displayed.
- A Fibonacci sequence is a sequence of numbers where each successivenumber is the sum of the previous two. The classic Fibonacci sequencebegins: 1, 1, 2, 3, 5, 8, 13, .... Write a program that computes the nthFibonacci number where n is a value input by the user. For example, ifn = 6, then the result is 8.Write a program that calculates the average word length in a sentence entered by a user.Write a program that reads the user's first name and last name, and then use them to create a UPM email for the user. If the total number of characters in the user's full name, (first name + last name), is less than 10 letters, you should use the full name to create the user’s email. The general format of the user’s email should look like this: firstName.lastName@upm.edu.sa For example: First name = Ali Last name = Omar Total number of letters in both first and last names = 7 letters (<10 letters) Output = omar.ali@upm.edu.sa If the number of characters in the user's full name, (first name + last name), is greater than or equal to 10 letters, you should only use the first character in the user’s first name, and the whole last name to create an email. For example: First name = Abdullah Last name = Omar Total number of letters in both first and last names = 12 letters (>=10 letters) Output = a.omar@upm.edu.sa Note: you can assume the user will always enter lowercase letters
- Write a program that reads a four-digit number from user, then the program separates digits of the number e.g., 4567 to be displayed as:4567Write a F95 program to concatenate two string firstName and last name. Print the concatenated string with message "Your Name is: ". Given firstName and lastName are of length 5 and also add space between firstName and lastName.c. Write a JAVA program to read input a string of length 8 and print "Valid Text" if the first half of the string is equal to the second half. Otherwise, if the first half is not equal to the second half then print "Invalid Text". If the length of the entered string is not equal to 8 then print the message "Size of string should be 8.".
- write a program that converts a binary (base 2) number to decimal (base 10). Your program should begin by reading the binary number from the user as a string. Then it should compute the equivalent decimal number by processing each digit in the binary number. Finally, your program should display the equivalent decimal number with an appropriate message.Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D, and E, possibly followed by + or -. Their numeric values are 4, 3, 2, 1, and 0. There is no F+ or F-. A + increases the numeric value by O.3, a – decreases it by 0.3. However, an A+ has value 4.0. Enter a letter grade: B- The numeric value is 2.7.The following code has several errors. Find out and circle the errors. <hello> <body> <p>Hello World</p> <p><b>Hello World</b></p> <p><strong>This text is strong</strong></p> <p><Big>This text is big</big></p> <p><me>This text is emphasized</em></p> <p><i>This text is italic</i><\p> <p><small>This text is small</small></p> <p>Hello World<sub>Hello World<sub> and <sup>Hello World</sup></p> </body> </html>