7.11 LAB: Print string in reverse Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Done", "done", or "d" for the line of text. Ex: If the input is: Hello there Неy done then the output is: ereht olleH yeH
Q: For reproducibility needed for auto-grading, seed the program with a value of 2. In a real program,…
A: The seed value is generally declare while creating instance of Random Numbers
Q: integers, and whose output is the first integer and subsequent increments of 5 as long as the value…
A: First we need to check if first integer is greater than second or not and then print the values if…
Q: Q1. Write a program that takes a range from the user and display all the even numbers between the…
A: /* C++ program to print the even numbers within the given range */ #include…
Q: 5) Write a program that reads three numbers and prints "increasing" if they are in increasing order,…
A: logic:- input three numbers . use > and && operator to check if they are in ascending…
Q: 5.12 LAB: Convert to binary Write a program that takes in a positive integer as input, and outputs a…
A: here in this question we have asked to write a program which take any input from user and convert it…
Q: HW 2: Identifiers and assignments (associated with lectures 5, 6 and 7) Write a program that will…
A: C Program for above : #include <stdio.h> int main() { //get user input…
Q: Python 3.7.4: Assume that C is a variable has been assigned a string value. Write an expression…
A: Since you have not specified what needs to be done in else part so we have included a print…
Q: #include using namespace std; int g = 100; int main() { int a; { int b; b = 20; a = 35; g…
A: Given, C++ code: #include <iostream> using namespace std; int g = 100; int main() { int…
Q: Q6: Write a program to find and print the value of (f) from the following equations for Fourteen…
A: The elif keyword is pythons way of saying if the previous conditions were not true then try this…
Q: Write a program that will calculate and print out bills for the city water company. The water rates…
A: Note: Programming language is missing in the question. So we will answer this program in C++. If you…
Q: Q#05: Write output of the following program and remove error if you find any #include using…
A: There are few errors in the code which have to changed. for (i=1;;) --> for statement should be…
Q: 4.18 LAB: Input and formatted output: House real estate summary Sites like Zillow get input about…
A: current_price=int(input())last_month_price=int(input())mortgage = (current_price *…
Q: 10 - In an examination, 500 students appeared. Out of these students, 38 % got A+ grade, 45 % got B+…
A: Program to find the number of students who got A+, B+ and the number of students who just passed.
Q: what is the output of the following c++ statement: int a, b, c, d; a = 5; b = 4; c = (++b +…
A: Given: what is the output of the following c++ statement: int a, b, c, d; a = 5; b = 4; c = (++b +…
Q: int i, j; for(i=3, j=4 ; i>10; --i,j--) { } printf("%d and %d", i, j);
A:
Q: Write a program that takes a date as input and outputs the date's season. The input is a string to…
A: To write python code for display the seasons accordingly.
Q: Write a program with total change amount as an integer input that outputs the change using the…
A: [Note: please use proper indentation to avoid erros. snapshots of program code are provided in step…
Q: 49- Find the output of the following program. * main(){ int a = 10, b, c; b = a++; C = a; cout << a…
A: The given code is - main(){ int a = 10, b, c; b = a++; c = a; cout << a << "…
Q: Q6: Write a program to find and print the value of (f) from the following equations for Fourteen…
A: Introduction:- Below is the complete solution with explanation for the given question in detail.…
Q: 4.18 LAB: Exact change Write a program with total change amount as an integer input, and output the…
A: Given The answer is given below.
Q: Many user-created passwords are simple and easy to guess. Write a program that takes a simple…
A: Generate temporary password is now a requirement on almost every website now-a-days. In case a…
Q: 7-The final result of the following statements is u = [0 0 1 1 0 1]; v = [011001]; u|v
A: Answer in step 2
Q: This is in c++ 1. Prompt the user to enter a string of their choosing and output the string. 2.…
A: Program to prompt the user to enter a string of their choice and display the string. The function…
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: 3.39 The computer game function collision() checks whether two circular objects col- lide; it…
A: To find collision of two circles we calculate distance between two centers and sum of two radius…
Q: Python 3.7.4: The current calendar, called the Gregorian calendar, was introduced in 1582. Every…
A: Create three functions in the program first is taking input from a user, second is checking whether…
Q: Python 3.7.4 Write a statement that associates s with the empty set.
A: Set:A set is a list of unranked data items, in python data items can be added or removed in a…
Q: Python 3.7.4 The current calendar, called the Gregorian calendar, was introduced in 1582. Every year…
A: The following is the source code which takes the input from the user and tells whether the input…
Q: Searching for Substrings
A: Program structure Includes header file <stdio.h> for input/output operations and…
Q: 9. Write a program that prints the numbers 1 to 4 on the same line with each pair of adjacent…
A: C++ program for the given problem:-
Q: Write a program that takes a date as input and outputs the date's season. The input is a string to…
A: CODE:- input_month = input()input_day = int(input())month= ('January', 'February','March', 'April'…
Q: 7. Let the statements A, B be given by A: not(p or q), B: (not p) or q. Let T= true, F = false. If p…
A: Given , A: not( p or q ) ; p = T ; q = F . i.e A = not ( T or F ) A = not ( T ) A = F
Q: *4.11 (Convert an uppercase letter to lowercase) Write a program that prompts the user to enter an…
A: programming language is not mentioned so providing answer in C++ The logic that we are using here…
Q: using chapters 1 to 10 from the book C how to program edition 8
A: #include <stdio.h>union integer{ char c; short s; long b; int i;};int main(void){…
Q: Q6: Write a program to find and print the value of (f) from the following equations for Fourteen…
A: Since the values aren't given with the question, we write the program to find f for any values of…
Q: 15. What is the output, if any, of the following C/C++ code? int a[5]=(3,4,5,6,7}; int…
A: Option a is syntax error because of main.c: In function ‘main’: main.c:9:13: warning: initialization…
Q: 50- Find the output of the following program. main(){ int a, b = 10; a = 95 / 10; cout << a << endl;…
A: Given data: 50: main() { int a, b = 10; a = 95 / 10; cout << a << endl;} 2:…
Q: C++ Question, Write a Computer Code: Let l be a line in the x-y plane. If l is a vertical line, its…
A: #include <iostream> using namespace std; int main(){ float m,x1,x2,y1,y2,b; cout…
Q: 6.17 LAB: Print string in reverse Write a program that takes in a line of text as input, and outputs…
A: Program: // Header files section#include <iostream>#include <string>using namespace std;…
Q: 7.14 LAB: Remove all non-alpha characters Write a program that removes all non-alpha characters from…
A: Please find the answer below :
Q: Python 3.7.4: Write a loop that reads positive integers from standard input and that terminates when…
A: Following is the program code that takes input from the user all positive integer and terminates if…
Q: Q6: Write a program to find and print the value of (f) from the following cquations for Fourteen…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Read the value of θ…
Q: 5.14 For each of the following sets of integers, write a single statement that will print a number…
A: a) Program code: //import required data package import java.util.Random; //main class public…
Q: Consider the following single-quoted string literal: 'baby robot' What is the character at index 1?
A: here in this question we have given a string s='baby robot' and we have to find out what would the…
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: b In multiplication, assume that leading zeroes are not allowed. Write a program in C++ to help…
A: Required: In multiplication, assume that leading zeroes are not allowed. Write a program in C++ to…
Q: 7. Write a function that evaluates the area of a pentagon. Use "math.pi", for pi, and "math.sqrt"…
A: Area of pentagon Pentagons can be convex or concave, regular or irregular. One with equal sides and…
Q: 5) Write a program that reads three numbers and prints "increasing" if they are in increasing order,…
A: """Program reads three number and prints increasing, decreasing or neitherbased in its values…
Q: 15. Let C be the set of all Circles in the world, and S be the set of all Squares in the world. Vx E…
A: In questions with many questions, we must answer first one
This is a pyhton , Coding the screenshot better explains. This prints the string in reverse.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- 21.7 LAB: Login name (Use python) Write a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input. Output the login name, which is made up of the first five letters of the last name, followed by the first letter of the first name, and then the last two digits of the number (use the % operator). If the last name has less than five letters, then use all letters of the last name. Ex: If the input is: Michael Jordan 1991 the output is: Your login name: JordaM91 Ex: If the input is: Kanye West 2024 the output is: Your login name: WestK245.23 In Python: Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is: 0 or less, the output is: no change Ex: If the input is: 45 the output is: 1 quarter 2 dimes Your program must define and call the following function. The function exact_change() should return num_dollars, num_quarters, num_dimes, num_nickels, and num_pennies.def exact_change(user_total)4.18 C++ Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer. End with a newline. Ex: If the input is: -15 10 the output is: -15 -10 -5 0 5 10 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than the first. For coding simplicity, output a space after every integer, including the last.
- 4.18 C++ Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer. End with a newline. Ex: If the input is: -15 10 the output is: -15 -10 -5 0 5 10 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than the first.5.12.2: Switch statement to convert letters to Greek letters. Write a switch statement that checks origLetter. If 'a' or 'A', print "Alpha". If 'b' or 'B', print "Beta". For any other character, print "Unknown". Use fall-through as appropriate. End with newline. import java.util.Scanner; public class ConvertToGreek {public static void main (String [] args) {Scanner scnr = new Scanner(System.in);char origLetter; origLetter = scnr.next().charAt(0); /* Your solution goes here */ }}3.27 LAB: Login name Write a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input. Output the login name, which is made up of the first six letters of the first name, followed by the first letter of the last name, an underscore (_), and then the last digit of the number (use the % operator). If the first name has less than six letters, then use all letters of the first name. Ex: If the input is: Michael Jordan 1991 the output is: Your login name: MichaeJ_1 Ex: If the input is: Nicole Smith 2024 the output is: Your login name: NicoleS_4
- 4.17 In Python, Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Quit", "quit", or "q" for the line of text. Ex: If the input is: Hello there Hey quit then the output is: ereht olleH yeHQ_4.*. A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers. Given a string s, return true if it is a palindrome, or false otherwise. Example 1: Input: s = "A man, a plan, a canal: Panama" Output: true Explanation: "amanaplanacanalpanama" is a palindrome. Example 2: Input: s = "race a car" Output: false Explanation: "raceacar" is not a palindrome..C++ 10.19 Given a line of text as input, output the number of characters excluding spaces, periods, exclamation points, or commas. Ex: If the input is: Listen, Mr. Jones, calm down. the output is: 21 Note: Account for all characters that aren't spaces, periods, exclamation points, or commas (Ex: "r", "2", "?"). code provided: #include <iostream>#include <string>using namespace std; int main() { string userText; // Add more variables as needed getline(cin, userText); // Gets entire line, including spaces. /* Type your code here. */ return 0;}
- Python 3.7.4: Write a loop that reads strings from standard input, where the string is either "duck" or "goose". The loop terminates when "goose" is read in. After the loop, your code should print out the number of "duck" strings that were read. ----------------- This is what I tried so far, and it's been marked wrong by MyProgrammingLab: count = 0inputstring=input("Enter goose/duck: ")countducks=0while inputstring!="duck": countducks+=1 inputstring=input("Enter either the word goose or duck: ")print(countducks, "This is the number of times duck was entered:" count)0.O.9. Write a Java program to check if a given string is a palindrome or not. A palindrome is a word, phrase, number, or other sequence of characters that reads the same backward as forward, ignoring spaces, punctuation, and capitalization. For example, "racecar" and "Madam" are palindromes, while "hello" and "Java" are not. Your program should take a string as input and return true if it's a palindrome, and false otherwise.. Absolutely.5.18 LAB: Print string in reverse Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Done", "done", or "d" for the line of text. Ex: If the input is: Hello there Hey done then the output is: ereht olleH yeH Use, Python please.