6b conditionais Write a program that, after it prints the score, prints Good job!" if `score' is greater than '80' and prints "You can do better." otherwise. The program should print Done at the end no matter what. Your output should be Your score was 85 Good job! Done Please use double quotes for your strings on this exercise - just like in the second problem of this set. 1 score - 85 2 print("Your score was + str(score)) Submit
Q: f) Prompt the user to enter a string s and an integer n. Write a program to add n spaces in starting…
A: Given : An integer n and a string s taken input from user. Requirement: Write a program in C++…
Q: Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the number…
A: C# is a general purpose multi-paradigm programming language developed and used by Microsoft. It…
Q: 3. Write a program that plays a guessing game with the user. The program should generate a random…
A: According to the information given:- We have to follow the instruction in order to create guess game…
Q: I cant get it right. Modify the BarChart program from Chapter 6 Exercise 13 to accept the number…
A: Algorithm: Start Read points scored by each player in a season Divide the points of each player by…
Q: Q7: Write a program that reads a collection of car speeds as long as the speeds do not exceed 100…
A: Program Approach: Including necessary header files Using namespace for standard input output…
Q: mplete the following program that collects an input word from the keyboard and finds if th indrome.…
A: Python code: word = input("Enter a word: ")is_palindrome = Truei=-1 for j in range(0, len(word)):…
Q: Q1: Write a program that read 10 Marks and print number of failed and succeeded marks.
A: Note: As no programming language is mentioned, therefore answering in python. Input to the Program :…
Q: b) Trace the following program and determine the output (show working): int x = 23; if (x >= 23) {if…
A: Program will print TULIP .
Q: Write a program called StudentTable that prints the below table. Use only print() orprintf(). DO NOT…
A: The "print()" and "printf()" function are available in C language and "println()" function is only…
Q: Create a program that will ask user to input two numbers and choose from the four mathematical…
A: Program Explanation: Declare the required header file Define the main function Declare variables…
Q: 3.5 LAB: Exact change Write a program with total change amount as an integer input, and output the…
A: Here I am using Java language to solve this question. Java Code: import java.util.*; public class…
Q: 5. Write a program that prints a Christmas tree, as shown below. Remember to use escape sequences.…
A: The above program is solved using Java Program below:
Q: ?(Is empty string e L(G * Yes No O O
A: Is empty string belongs to L(G)
Q: Using While Loop in Java Write a program that let the user include his or her three (3) grades.…
A: Algorithm Start Var grade [3], sum=0 Accept all 3 grade from user Compute sum of these grade in sum…
Q: Q3: Write a VB program to enter a mark of a student and then find his grade as follows: If mark >=75…
A: VB program is asked with the following conditions: If mark>=75 print Grade = A If…
Q: Write a c++ Develop a version where the player makes bet. If the Player guesses the first time, the…
A: C++ code to construct a game to guess number by betting money
Q: Program to accept and print a string using classes.
A: Given, We have to write a program to accept and print a string using class.
Q: Q49. Write a program which replace all the words "man" with "woman". Sample Text: That is a…
A: NOTE: As the programming language is not mentioned in the question. So, we have solved this question…
Q: Q29) Consider you have a list of 20 exam scores. Write a computer program that calculates the…
A: #Code in MATLAB: clear; a=[73, 91, 37, 81, 63, 66, 50, 90, 75, 43, 88, 80, 79, 69, 26, 82, 89, 99,…
Q: Three variables, x, y, and z, supposedly hold strings of digits, suitable for converting to…
A: Below is the required python program: - Approach: - Ask the user to enter the value of x, y, and z.…
Q: 6- Write a program to read three numbers A,B,C then find whether A,B,C can form the sides of a…
A: Note: As no programming language is mentioned, therefore answering the given question in python.…
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A: The below given C++ program code will obey the following rubrics: Including necessary header files.…
Q: (a) Write two different techniques to declare and initialize a variable with an example. (b) Write a…
A: Since we can answer up to 1 question only so we will answer first question. Please resubmit the…
Q: Write a program to use enumeration type to represent the seven colors of the rainbow, i.e. red,…
A: switch (choice) { case 1: cout << "Red color is chosen. The next color is…
Q: Q3) Write a program that converts the weather from Celsius to Fahrenheit in a specific day. The…
A: Program Code:
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A: C++ Program for above : #include <iostream> #include <algorithm> #include…
Q: Q4 write a program that accepts a day, month and year then calculate the day of year corresponding…
A: Given requirement, Write a program that accepts a day, month and year then calculate the day of the…
Q: 6. Write a program that (i) declares a string str_a (of size (LAST_FOUR_DIGITS_OF_YOUR_STUDENT_ID %…
A: Step 1: Accept a string from the user and store it in str_a. Step 2: Scan the characters of the…
Q: 5. Write a program that determines the change to be dispensed from a vending machine. An item in the…
A: The program accepts the input value to a variable. It declared other variables for storing the…
Q: Q: Write a program that will show the following output of the string "Rroduct. Name: HP Laptop…
A: The given program is a simple case of displaying given output. Print statements can be used to…
Q: Q5/ 1. 1. Write a program to read three marks and calculate the average. If the student's average is…
A: Since no programming language is mentioned, I am using python. As per our guidelines, we are…
Q: Q17: Given that A and B are real variables with values 1.5, and 2.5 respectively, and C is integer…
A: 17. ) given, A = 1.5 B = 2.5 C = 3. so, NOT( A < 0 ) AND ( B/C <= 0 ) = NOT( 1.5…
Q: 1- Let's start with some mediationO Print the following pattern on to the screen; uses one printf ()…
A: Algorithm: Start Print the given statements using printf() Read 3 numbers x,y,z Initialize sum to 0…
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: 17.25 LAB: Print string in reverse Write a program that takes in a line of text as input, and…
A: C++ program to reverse the string and break the code run when DONE is entered
Q: n C++ write a program that prompts the user to enter three strings and then make a new string formed…
A: Given: Three strings taken input from user. Requirement: Write a program to read the strings from…
Q: PART G: COUNT HIGiven a string str, output the number of times the string “hi” appears anywhere in…
A: Program to enter a string and print the number of occurrences of that string.
Q: - write regular expressions which recognize each of the following things: Strings which contain the…
A: Regular Expression Regular expression is a set of pattern used in string to manipulate, search and…
Q: This following program is intended to print something sensible. .ORIG LEA R1, ? A ADD R1, R1, -2 B…
A: The OUT instruction prints something that is in R0 To print the string, the label should be I at ?…
Q: 7) Write a code that content of AL is 10. Compare with 10. If numbers are equal, Jump to label NEXT…
A: Assembly language program to compare two numbers .
Q: a. Write a program that reads your id and full name and display. And also display the index of first…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Read id and name…
Q: Write a program that takes a date as input and outputs the date's season. The input is a string to…
A: Note: Since the programming language is not mentioned we are providing the solution in Python…
Q: 3. Re-write the following program by using switch statement. int main() { int code; cout>code; if (…
A: The given problem is related to C++ programming where the given code has used if-else statement…
Q: Can you please rewrite these cods for me in a simple way without the '/n' and '/t' , also show me…
A: #include<iostream>using namespace std;// the main bodyint main(){ std::string…
Q: 6- Write a program to read three numbers A,B,C then find whether A,B,C can form the sides of a…
A: Required: write a program to check if a triangle is valid or not and if valid then check if it is…
Q: 3.13 LAB: Exact change Write a program with total change amount as an integer input, and output the…
A: coded in python to get the above output of exact changes (Python Language)
Q: C# Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the…
A: Algorithm: Start Read enter the number of days for a resort stay n If n==1 or n==2,calculate cost…
Q: Write a program that prompts the user to enter twostrings and displays the largest common prefix of…
A: Since the programming language is not mentioned in the question, we will answer this question in the…
Q: Car experts recommend changing your air filter as often as every 6000 miles if the oil’s category is…
A: import java.util.Scanner;class CarDemo{public static void main(String[] args){ int…
Q: Lab #05 Exercise Write a program to enter 2 out of 3 angles in a triangle, in degrees. Your program…
A: Please give positive ratings for my efforts. Thanks. PROGRAM a = float(input("Enter the first…
Step by step
Solved in 3 steps with 4 images
- Question # 8: Write a program that inputs a number and checks whether it is a perfect number or not. A perfect number is the number that is numerically equal to the sum of its divisors. For example, 6 is a perfect number because the divisors of 6 are 1, 2, 3 and 1+2+3=6Q3) Write a program that reads a string from the keyboard and tests whether it contains a valid date. Display the date and a message that indicates whether it is valid. If it is not valid, also display a message explaining why it is not valid. The input date will have the format dd/mm/yyyy. A valid month value mm must be from 1 to 12 (January is 1). The day value dd must be from 1 to a value that is appropriate for the given month. September, April, June, and November each have 30 days. February has 28 days except for leap years when it has 29. The remaining months all have 31 days each. A leap year is any year that is divisible by 4 but not divisible by 100 unless it is also divisible by 400. Sample Input#1: Please enter a date to be checked: 05/04/2021 Sample Output#1: Your date was 05:04:2021 It is a valid date. Sample Input #2: Please enter a date to be checked: 32/03/2021 Sample Output #2: Your date was 32:03:2021 It isn’t a valid date.The reason it is…Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outputs Yes if every character is a digit 0-9. Ex: If the input is: 1995 the output is: Yes Ex: If the input is: 42,000 or 1995! the output is: No Hint: Use a loop and the Character.isDigit() function.
- (Misc. application) a. Write a program to reverse the digits of a positive integer number. For example, if the number 8735 is entered, the number displayed should be 5378. (Hint: Use a do statement and continuously strip off and display the number’s units digit. If the variable numinitially contains the number entered, the units digit is obtained as (num % 10). After a units digit is displayed, dividing the number by 10 sets up the number for the next iteration. Therefore, (873510)is5and(8735/10)is873. The do statement should continue as long as the remaining number is not 0.) b. Run the program written in Exercise 3a and verify the program by using appropriate test data./ 4. // Write an if/else statement such that if `varA` and `varB` are strings or // numbers and they have equal values, then change the value of answer4 to // "varA and varB are equal" // otherwise assign a value of "varA and varB differ" function exercise4(varA, varB) { let answer4; // -------------------------------------------- // Write your code for the exercise below here: // -------------------------------------------- // -------------------------------------------- // And above here // -------------------------------------------- return answer4; } 5. // In exercise 4, what are some of the unexpected cases where `varA` and `varB` // seemed like they are equal, but would not pass the tests? Consider other data types beside strings and variables. plase answer in javascriptstoppingDistance = speed * (2.25 + speed / 21)Write a program which determines whether a vehicle’s tailgating distance is safe.The program should read in the speed of the vehicle and the vehicle’s tailgatingdistance. The program should then calculate the distance that would be required tostop the vehicle.If the stopping distance is less than the tailgating distance, your programshould print “No problem.” If the stopping distance equals the tailgatingdistance, your program should print “Minor wreck.” If the stopping distanceis greater than the tailgating distance, your program should print “Majorwreck!”
- stoppingDistance = speed * (2.25 + speed / 21)Write a program which determines whether a vehicle’s tailgating distance is safe.The program should read in the speed of the vehicle and the vehicle’s tailgatingdistance. The program should then calculate the distance that would be required tostop the vehicle.If the stopping distance is less than the tailgating distance, your programshould print “No problem.” If the stopping distance equals the tailgatingdistance, your program should print “Minor wreck.” If the stopping distanceis greater than the tailgating distance, your program should print “Majorwreck!”Notice that the expression on the right side of the formula above will force thecompiler to convert everything to type double. Use type double for your workingvariables. Write your program so that it is able to produce the following screendisplay:Sample session:Enter your speed (in mph): 60.0Enter your tailgate distance (in feet): 240.0Major wreck!Car experts recommend changing your air filter as often as every 6000 miles if the oil’s categoryis A. However, if the category is B, it is recommended to change the filter every 3000 miles. Write a programthat reads the oil’s category and the car trip miles then does the following:- Prints “Wrong category” if the category entered by the user is different than ‘A’ and ‘B’.- Prints “You should change your car filter!” if it is time to change the filter according to the category (i.e.when miles are above 6000 for A or miles are above 3000 for B).- If it is not the time to change the filter, the program prints the remaining miles and wishes the driver asafe drive. (use while)Car experts recommend changing your air filter as often as every 6000 miles if the oil’s categoryis A. However, if the category is B, it is recommended to change the filter every 3000 miles. Write a programthat reads the oil’s category and the car trip miles then does the following:- Prints “Wrong category” if the category entered by the user is different than ‘A’ and ‘B’.- Prints “You should change your car filter!” if it is time to change the filter according to the category (i.e.when miles are above 6000 for A or miles are above 3000 for B).- If it is not the time to change the filter, the program prints the remaining miles and wishes the driver asafe drive.
- An employee is paid at a rate of $16.78 per hour for regular hours worked in a week. Any hours that are paid at the overtime rate of one and one half times that. From the worker’s gross pay 6% is withheld for social security system tax, 14% is withheld for federal income tax, 5% is withheld for state incofor union dues. If thfor health insurance beyond what the employers pays. Write a program that will read 25 employees the number of hours worked in a week and the number of dependents as input, and will then output the worker’s gross pay, each withholding amount and the net take home pay for the week.Singular to Plural. Create a program that accepts a word in singular, and produces the corresponding plural. Use the following rules: a. If the word end in ‑s, -ss, -sh, -ch, -x, or –z, then add –es to the word. For example, the plural of tax is taxes b. If the word ends in -fe, then replace the ending with –ves. For example, the plural of wolf is wolves c. If the word ends in y and the previous letter is a vowel, then add –s to the word. For example, the plural of boy is boys d. If the word ends in y and the previous letter is a consonant, then change the –y ending with –ies. For example, the plural of city is cities e. If the word does not meet the criteria above, then add –s to it.Nice Number Programming: Nice program ask user to enter three integers from keyboard (java console), the three integers represent left bound, right bound and arbitrary digit 'm', where left bound is less than right bound. Program should print all nice numbers in the given range that doesn't contain digit 'm'. The number is nice if its every digit is larger than the sum of digits which are on the right side of that digit. For example 741 is a nice number since 4> 1, and 7> 4+1. with digit m=2. Write a complete program in Java that Call only One method (niceNumbers method) that will print all nice numbers excluding a given digit 'm' that also entered by user?