Char type: Edit the provided starter-code char_type.py so it takes the user to enter some text, then display the number of vowels, consonants,digits, and special characters in the text. In english the vowels are the letters "a" , "e" , "i", "o", "u", "y". All other letters are consonants. The digits are "0"-"9". The special characters are those that are not letters or digits. The program should countthe number of each type of character in the text user enters, then print the result like this:
vowels:14
consonants:8
Digits:9
Special:3
hint : use if-elif -else statements to distinguish the different types of characters.
Python3 code
# char_type.py
vowels = 0
consonants = 0
digits = 0
specials = 3
punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
# Reading text
text = input("Enter text: ")
# Looping through each characters of text
for x in text.lower():
if(x.isalpha()):
if(x in "aeiou"):
vowels += 1
else:
consonants += 1
elif(x.isdigit()):
digits += 1
elif(x in punctuation):
specials += 1
# Printing output
print("vowels:"+str(vowels)+"\nconsonants:"+str(consonants)+"\nDigits:"+str(digits)+"\nSpecial:"+str(specials))


Char type: Edit the provided starter-code char_type.py so it takes the user to enter some text,...
Can someone please edit my current code to accept a user input for the text file name in lieu of how it currently will read data1.txt. Also if the user enters a data file that isn't ready to be used, cout a statement "cout << "Could not open file " << userInputforData.txt << endl; Another condition that I need to add is if there is a special character anywhere in the word it cannot be an acceptable variable name. could...
a. Ask the user for the input of a letter (char type). Write a function that takes a char as the argument (parameter) and returns the ASCII value of that char back to the caller. Call the function using the char variable and taking input from the user (no validation required). Display the value in ASCII. b. Write a program that takes a char as the argument (parameter) and uses a loop to interrogate the char, calling a function that...
This is Python
The program should accept input from the user as either 7-digit
phone number or 10-digit. If the user enters 7 characters, the
program should automatically add "512" to the beginning of the
phone number as the default area code. Dash (hyphen) characters do
not count in input character count, but must not be random. If the
user enters dashes the total character count must not exceed
12.
The program should not crash if the user enters invalid...
14.3: More Sentences Write a program that allows a user to enter a sentence and then the position of two characters in the sentence. The program should then report whether the two characters are identical or different. When the two characters are identical, the program should display the message: <char> and <char> are identical! Note that <char> should be replaced with the characters from the String. See example output below for more information. When the two characters are different, the...
C Code Create a tool in which a user can enter a string (up to 25 characters) and choose how they wish to manipulate the string from a menu your program will display (see the run-through). The program will continue to ask for commands until the user enters the “quit” command. The commands are: • “Replace All” If a user types “replace all” using ANY sort of capitalization, your program will prompt the user to enter the character to change...
(1) Prompt the user to enter a string of their choosing. Store the text in a string. Output the string. (1 pt) Ex: Enter a sample text: We'll continue our quest in space. There will be more shuttle flights and more shuttle crews and, yes, more volunteers, more civilians, more teachers in space. Nothing ends here; our hopes and our journeys continue! You entered: We'll continue our quest in space. There will be more shuttle flights and more shuttle crews...
I need eclipse code for : Write a program that analyzes text written in the console by counting the number of times each of the 26 letters in the alphabet occurs. Uppercase and lowercase letters should be counted together (for example, both ‘A’ and ‘a’ should count as an A). Any characters that are not letters should be ignored. You must prompt the user to enter the text to be analyzed. Then, for any letter that appeared at least once...
The skeleton code (starter file) for the problem is pasted
below:
def phoneNumber(letters):
result = ""
# ADD YOUR CODE HERE
return result
def loadEvents(filename):
events = {}
# ADD YOUR CODE HERE
return events
def timeline(events):
# ADD YOUR CODE HERE
return
# DO NOT modify or remove the code below! We will use it for
testing.
if __name__ == "__main__":
# Problem 1: Decoding Telephone Numbers
ph = input("Enter the text to translate: ")
print("The corresponding phone number...
Need this in C
The starter code is long, if you know how to do it in other way
please do.
Do the best you can please.
Here's
the starter code:
//
-----------------------------------------------------------------------
// monsterdb.c
//
-----------------------------------------------------------------------
#include
#include
#include
//
-----------------------------------------------------------------------
// Some defines
#define NAME_MAX 64
#define BUFFER_MAX 256
//
-----------------------------------------------------------------------
// Structs
typedef struct
{
char name[NAME_MAX];
int hp;
int attackPower;
int armor;
} Character;
typedef struct
{
int size;
Character *list;
} CharacterContainer;
//
-----------------------------------------------------------------------
//...
please answer correctly and follow the code structure given [JavaFX/ Exception handing and text I/O] 1. Write a program for the following. NOTE that some of these steps are not dependent on each other. Using methods is mandatory. Make sure to use methods where it makes sense. a. Ask the user for a series of integers entered from the keyboard. Use a sentinel value such as 999 to end the input process. If the entered values are not integers, throw...