14.3: More Sentences
<char> and <char> are identical!
<char> and <char> are unique characters.
Your output should look identical to the following, except user input will vary:
Welcome!
This program compares two letters in a sentence.
Enter a sentence or X to exit: Let's have cake and ice cream for
dinner!
Enter the numeric location of the first letter: 1
Enter the numeric location of the second letter: 9
e and e are identical.
Enter a sentence or X to exit: "Flight Behavior" is a good
book.
Enter the numeric location of the first letter: six
Error! Enter a number, not text!
Enter the numeric location of the first character: six
Error! Enter a number, not text!
Enter the numeric location of the first character: six
Error! Enter a number, not text!
Enter the numeric location of the first character: 6
Enter the numeric location of the second letter: 10
t and h are unique characters.
Enter a sentence or X to exit: Summer vacation is almost
here!
Enter the numeric location of the first letter: 2
Enter the numeric location of the second letter: three
Error! Enter a number, not text!
Enter the numeric location of the second character: three
Error! Enter a number, not text!
Enter the numeric location of the second character: three
Error! Enter a number, not text!
Enter the numeric location of the second character: 3
m and m are identical.
Enter a sentence or X to exit: x
Goodbye!
14.3: More Sentences Write a program that allows a user to enter a sentence and then...
Write a C program that takes two sets of characters entered by the user and merge them character by character. Enter the first set of characters: dfn h ate Enter the second set of characters: eedtecsl Output: defend the castle Your program should include the following function: void merge(char *s3, char *s1, char *s2); The function expects s3 to point to a string containing a string that combines s1 and s2 letter by letter. The first set might be longer...
IN C language Write a C program that prompts the user to enter a line of text on the keyboard then echoes the entire line. The program should continue echoing each line until the user responds to the prompt by not entering any text and hitting the return key. Your program should have two functions, writeStr andcreadLn, in addition to the main function. The text string itself should be stored in a char array in main. Both functions should operate...
****C PROGRAMMING**** (100 points) Write a program that prompts the user to enter the name of a file. The program encoded sentences in the file and writes the encoded sentences to the output file. Enter the file name: messages.txt Output: encoded words are written to file: messages.txt.swt The program reads the content of the file and encodes a sentence by switching every alphabetical letter (lower case or upper case) with alphabetical position i, with the letter with alphabetical position 25...
Exercise #3: write a Java program that prompts the user to enter a sentence. The program has to find the print: a. the position of vowels in the sentence. b. the number of vowels in the sentence (A, a, U, u, E, e, O, o, I, i) c. the number of characters as numbers or special characters (other than English letters a.z, A..Z). Hint: remember to ignore the spaces. Sample input-output: Enter the sentnse: UAEU is the university of the...
Objectives: Use strings and string library functions. Write a program that asks the user to enter a string and output the string in all uppercase letters. The program should then display the number of white space characters in the string. You program should run continuously until the user enters an empty string. The program must use the following two functions: A function called count_spaces that counts the number of white spaces inside a string. int count_space(char str[]); which tell you...
1. Write a program that prompts the user to enter three integers and display the integers in non-decreasing order. You can assume that all numbers are valid. For example: Input Result 140 -5 10 Enter a number: Enter a number: Enter a number: -5, 10, 140 import java.util.Scanner; public class Lab01 { public static void main(String[] args) { Scanner input = new Scanner(System.in); } } ---------------------------------------------------------------------------------------------------------------------------- 2. Write a program that repeatedly prompts the user for integer values from...
Write a program in python that asks the user to input a sentence. The program will ask the user what two letters are to be counted. You must use a “for” loop to go through the sentence & count how many times the chosen letter appears in the sentence. You are not allowed to use python built-in function "count()" or you'll get a Zero! Output will show the sentence, the letter, and the number of times the letter appears in...
Python program. Character-Analysis Program Problem Statement: Design a program - IN PYTHON - that asks the user to enter a string. The string will then be displayed back to the user. This is followed by determining the number of alphabetic characters, numeric characters, lower_case letters, upper_case letters, whitespace characters, and then displaying them. The user should be given additional chances to enter additional strings, and each time a string is entered, the above process is to be performed. The inputting...
USING PYTHON PROGRAMING LANGUAGE Write a program that first asks the user to enter a “special” letter. The program should then ask the user to enter a single line sentence containing all lowercase letters and no punctuation, except for a period at the end. The program will then output the number of times that this letter appears in the sentence. Example: Enter a special letter: t Enter a sentence: here is my little sentence. Your letter appears 3 times. (t...
(Process a string) Write a program that prompts the user to enter a string and displays its length and its first character. java StringLength Enter a string:Does quantum determinacy have anything to with whether human cognition is deterministic? The string is of length 88 and the first character is D import java.util.Scanner; class StringLength{ public static void main (String args[]){ Scanner input = new Scanner(System.in); System.out.println("Enter a string:"); String ans = input.nextLine(); System.out.println("The string...