Write a complete ilython program that prompts the user for his/her full name. Regardless of the user input, the program will produce output such that all of the first name will be in lower case, and the second name should be upper case except for the last letter which should be lower case.
Q: Write a program whose input is a character and a string, and whose output indicates the number of…
A: Here I have asked the user for character and the string and stored them into separate variables.…
Q: Write a program which takes distance in kilometer (km) as input from user and convert it to Miles…
A: GIVEN : Write a Program which converts kilometer into miles. Using python program.
Q: Write a program in phyton that takes in an integer in the range 11-100 as input. The output is a…
A: The asked python program has been coded by using a while loop for printing the countdown numbers and…
Q: Pyhton program that performs the following operations by reading the weight of athletes until a zero…
A: weight = Nonewhile weight!= 0: a_weight = input("Enter the weight of athletes (0 terminates): ")…
Q: Write a program whose inputs are three integers, and whose output is the smallest of the three…
A: Java is one of the most extensively used language, and In most of the back end development projects,…
Q: Write a program that keeps on taking numbers from the user, until the user enters any input that it…
A: Answer: Java Source Code: import java.util.*;import java.lang.*;public class Main { public static…
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A: The answer is
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A: Answer: This is simple program we have written code in next page also i have inserted screenshot of…
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A: phyton code described below
Q: Write a program that reads in hours, minutes, as input, and outputs the time in minutes only.
A: The language i used is C++. I explained the program in comments of the code and also attached the…
Q: Write a program that prompts the user to enter the year and thefirst three letters of a month name…
A: Since, here no programming language is specified. So, we are providing the solution in Java. The…
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A: 1. run an infinite while loop 1.1 input a string 1.2 if the string is "done" or "Done" or "d" then…
Q: Write a program which takes an input from the user, if the input is 1, calculate the area of the…
A: ALGORITHM:- 1. Display the menu. 2. Take input for choice. 3. Take input for various parameters to…
Q: Write a program whose input is a character and a string, and whose output indicates the number of…
A: - We need to code the relation. We have to use java here.
Q: Write a program that reads in an integer and breaks it into a sequence of individual digits. For…
A: We will be solving the question in Python for easy understanding. We will be taking our input in a…
Q: Write a program whose input is a character and a string, and whose output indicates the number of…
A: Program: //import the required packages import java.util.Scanner; //define a class Main public class…
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A: Code with explanation: lst = [ ] // list to store the input strings.lt=[] // list to store the…
Q: Write a program that receives a double value from the user, deducts 1 from it, and prints it with…
A: #include<bits/stdc++.h>using namespace std; int main(){ while(1) { double n; cin…
Q: Write a program that reads a person's first and last names, separated by a space. Then the program…
A:
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse.
A: Answer: In c: #include<stdio.h>#include<string.h>int main(void){ char str[100];…
Q: Write a program that reads a person's first and last names, separated by a space. Then the program…
A: Here the scanner object is scnr. Thus using this, we can read the firstName and lastName.
Q: Write a program that interactively reads lines of input from the user and prints them back out,…
A: Approach Here, we have used a while loop that asks the user to input a line of text until the user…
Q: Write a program that translates a letter grade into a number grade. Letter grades are A, B, C, D,…
A: Program that translates a letter grade into a number grade. Algorithm: Start Input a letter…
Q: Write a program whose input is a character and a string, and whose output indicates the number of…
A: class GF{ public static int count(String s, char c) { int res = 0; for (int i=0; i<s.length();…
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A: Below i have given program:
Q: Write a program that takes in an integer in the range 20-98 as input. The output is a countdown…
A: 1. 1st digit = number % 10 2. 2nd digit = number / 10 3. If 1st digit is equal to 2nd digit 1.…
Q: Write a program that mimics a calculator. The program should take as input two integers and the…
A: A set of data from a sample of items is given. (a) The covariance between two random variables X and…
Q: Write a program on eclipse that reads an unspecified number of scores and determines how many scores…
A: NOTE : Since programming language is not mentioned.Therefore answering question in Java language.…
Q: Write a program to read and print 6 temperatures for 6 days and find the average for these degrees…
A: Since programming language was not mentioned , so I used PYTHON-- I have provided PYTHON CODE…
Q: Write a program whose input is a character and a string, and whose output indicates the number of…
A: import java.util.Scanner;public class Library{ public static int calcNumCharacters(String…
Q: Write a program whose input is a string which contains a character and a phrase and whose output…
A: Program Overview In this program using python code We have to find the Total Count of occurrence of…
Q: Make a program that would input the year code (between 1 and 4) and output "Freshman", "Sophomore",…
A: The if-else statement is used to perform the operations based on some specific condition.
Q: Write a program that creates a login name for a user, given the user's first name, last name, and a…
A: Textual Python Code :- firstName = input ("Enter first name :")lastName = input("Enter last name :…
Q: Write a program that reads in a farenheit temperature as a decimal number and outputs the equivalent…
A: C++ program to solve the given problem is below. ****As there is no programing language…
Q: Your program needs to read in two words on a single line. If the pair of words are Super Anagrams of…
A: Here, I have to provide a python solution to the above question.
Q: Write a program in C++ that : • Asks user to input an integer numbers, until the user input 0. •…
A: Algorithm: Start Initialize evenCount=0,oddCount=0, positiveCount=0, negativeCount=0; Ask the user…
Q: Write a program in nim to take name as input and then print if it's name is empty then print you…
A: Required:- Write a program in nim to take the name as input and then print if its name is empty then…
Q: make this into a problem: Here we have implemented the program that displays whether the user input…
A: Note:- always mention programming language name. This program is done using c++. logic:- read A, B…
Q: Write a program that prompts and takes an input from a user with values ranging from 4 to 10 and…
A: We need to write a program in python language that display the diamond pattern given in the…
Q: Write a program that takes website names as keyboard input until the user types the word stop and…
A: Given :- Write a program that takes website names as keyboard input until the user types the word…
Q: Please write a Python program which accepts a sentence (input via keyboard), and convert uppercase…
A: For the given program, we ask the user the input using the input() function and loop through each…
Q: Write a program whose input is two integers, and whose output is the first integer and subsequent…
A: import java.util.*;public class Main { public static void main(String[] args) { Scanner scan…
Q: Write a python program that takes 2 inputs from the user. The first input is a string and the second…
A: Given: Write a python program that takes 2 inputs from the user. The first input is a string and the…
Q: Write a program whose input is a string which contains a character and a phrase, and whose output…
A: The user inputs a character and a phrase. The entered string is separated into individual elements.…
Q: Write a program whose input is a string which contains a character and a phrase, and whose output…
A: Hello Student I will explain the whole solution in next stes Please do like :-
Q: A certain CS professor gives 100-point exams that are graded on the scale 90-100:A, 80-89:B,…
A: Since no programming language is mentioned, I am using python Algorithm: Start Read exam score If…
Q: Write a program whose inputs are three integers, and whose outputs are the largest of the three…
A: Python code for above: # function to return largest def largest_number(num1, num2, num3):…
Q: Create C program that loops from 1 to 30 and prints out each value on a separate line, except print…
A: Please give positive ratings for my efforts. Thanks. PROGRAM #include <stdio.h> int main()…
Q: Write a program whose input is two integers. Output the first integer and subsequent increments of 5…
A: The code for the above-given question is given below:
Q: Write a program using integers user_num and x as input, and output user_num divided by x three…
A: Step 1: Prompt and accept the values of two integers. Step 2: Divide the first integer by the second…
def main():
name = input("Enter your name: ") # Inputting the name
parts = name.split() # Extracting out first name and second name from name
firstName = parts[0]
secondName = parts[1]
firstName = firstName.lower() # Converting the first name to lower case
secondName = secondName[:-1].upper() + secondName[-1].lower() # Converting the second name to upper case, the last letter to lower case
print(firstName, secondName) # Displaying the name
if __name__ == "__main__":
main()
Step by step
Solved in 3 steps with 2 images
- Write a computer program that calculates the bullet train’s constant rate of acceleration, given an initial speed of 200 mi/hr. Your program reads inputs; time intervals (t) and final velocity (vf ); from an input file and output the calculated acceleration value (a) to an output file. Hint: A bullet train slows from a speed of 200 mi/hr to 150 mi/hr in one minute. Use the equation below, where a is acceleration, t is time interval, vi is initial velocity, and vf is final velocity. Your source code should include following functions: - Main function that declares two files for input/output values, and calls the following function o A function that computes and return a, given t, vf, and viWrite a program that reads a text and outputs the letters, together with their counts, as explainedbelow in the function printResults. Your program should not have any global variables. Allinformation should be accessed through the parameters of the functions. Your program should:have the at least the following functions:• Function main – calls all the functions• Function openFile – opens the input and ouput files. This program has the file streamdeclare a refence parameter. An appropriate error message should be displayed if the filedoes not exist. The program must ask the user for the names of the input and output files.• Function countLetters – counts every of uppercase letters A – Z and lower-case lettersfrom a – z in the text file opened in the function openFile. This information should be storedin an array of structures. Both the array and file identifiers must be passed as parameters.• Function printResults – prints the number of uppercase letters for every occurrence of A–Zand…Write a program that reads a text and outputs the letters, together with their counts, as explainedbelow in the function printResults. Your program should not have any global variables. Allinformation should be accessed through the parameters of the functions. Your program shouldhave the at least the following functions:• Function main – calls all the functions• Function openFile – opens the input and ouput files. This program has the file streamdeclare a refence parameter. An appropriate error message should be displayed if the filedoes not exist. The program must ask the user for the names of the input and output files.• Function countLetters – counts every of uppercase letters A – Z and lower-case lettersfrom a – z in the text file opened in the function openFile. This information should be storedin an array of structures. Both the array and file identifiers must be passed as parameters.• Function printResults – prints the number of uppercase letters for every occurrence of A–Zand…
- Please Write a program that reads data from a file containing integers that ends with -999. Output the numbers that are divisible by 7 Output the numbers that are divisible by 11 Output the numbers that are not divisible by 7 or 11. OkIn Python IDLE Write a program that reads the file’s contents and determines the following: The number of uppercase letters in the file The number of lowercase letters in the file The number of digits in the file The number of whitespace characters in the file Then the program should do a mass replacement of all spaces with a ‘-‘, and then replace any uppercase letters with lowercase letters. After the replacement of the spaces, the count of letters, digits, and spaces should be rerun, the number of replacements indicated, and a second report of letters, digits and spaces should be printed. Save the results of the changes in a file named “testoutput.txt”. This file must be submitted as part of the submission for your lab. Output should look like this: Uppercase letters: 20 Lowercase letters: 310 Digits: 4 Spaces: 82 >>> Hint: This program does not need to use any lists – the entire file can be read into one string. Problem 2. Date Printer - Write a program…Below this question is a generated text representing a DNA sequence. The first line starts with '>' and is a comment, and the lines after that hold the sequence. The sequence has letters 'A', 'C', 'T', and 'G'. In your program (written in python) for this question, read the sequence using the statements: f = open('kdpF.txt') # opens a file for reading line = f.readline() # reads a single line print(line) seq = ''for line in f : # reading the rest of the lines seq = seq + lineseq = seq.replace('\n', '') # removing the newline characters seq = seq.upper() print(seq) def gcContent(sequence) : # You do the rest pass Also write a function gcContent(sequence), which returns the percent of the sequence which is either 'G' or 'C'. Use your function on the input sequence and print the results. generated text DNA sequence: >200 bp region of the chromosome of E. coli, containing gene kdpF, shortest…
- Create a program that calculates the average test scores. Given the student’s name and five test scores, calculate the test scores. The student’s name, five test scores and the average test score is stored in the file testaverage.txt. The data is input from the file test.txt. Sample Run Input file (Contents of the file test.txt) Andrew Miller 87.50 89 65.75 37 98.5 Output file (Contents of the testaverage.txt) Student Name: Andrew Miller Test Scores: 87.50 89.00 65.75 37.00 98.50 Average test score: 75.75Write a complete program that reads integers from a file called numbers.txt, and displays their sum on the screen. Example: If the content of numbers.txt is: 10 20 30 100 The program should print: 160Program should be written in c++Write a Python program that reads from the user the name of two files (an input file and an output file). The program will then read each line of the input file and save it in the output file preceded with the line number and removing any of the following punctuations (. , ! ? ; :) found at the end of the line. For example, if the input file is:Mary had a little lamb;Whose fleece was white as snow; And everywhere that Mary went; The lamb was sure to go!Then the output file the content of the input file and saves it in the produced output file will beLine 1: Mary had a little lambLine 2: Whose fleece was white as snow Line 3: And everywhere that MaryLine 4: The lamb was sure to go
- Write a program that reads student data from a file, compute their GPA and writes the results to a different file. 1. The user should have the option to either enter their text file that contains the student grades or use the provided text file that contains theinformation. The data in "indata.txt" should look similar to this, Lara_Croft75 70 91 69 89Chris_Redfield68 88 79 85 94Johnny_Cochran69 98 95 77 80Wanda_Maximoff84 86 98 95 92Luke_Skywalker74 96 80 98 97William_Kurt89 52 99 81 58Samuel_Jackson50 96 50 64 95END_OF_FILE This is supposed to be in python. This is what I have so far. I have no experience I apologise. I am trying to finish the GPA calculating program currently but am having trouble finishing it. grade = input("enter grades")points = 0 if grade is 90-99:total_points = 4.0if grade is 80-89:total_points = 3.0if grade is 70-79:total_points = 2.0if grade is 60-69:total_points = 1.0if grade is 50-59:total_points = 0.0gpa = total_points/len(grade)print(gpa,"is gpa")Write a complete python program with a main function that reads from a file called numbers.txt and outputs to a file called answers.txt Numbers.txt has one or more lines where each line contains two numbers Your program should read through numbers.txt and with each line. Multiplies the first number by the second and outputs the results to answers.txt If inputs.txt contained 5 4 3 4 6 4 After your program runs answers.txt should contain 20 12 24Write a program that reads a file consisting of students' test scores in the range 0-200. It should then determine the number of students has scored in each of the following ranges:0-24, 25-49, 50-74, 75-99, 100-124, 125-149, 150-174, and 175-200. Output the score ranges and the number of students. (Run your program with the following input data: 76, 89,150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129,149, 176, 200, 87, 35, 157, 189.)