In: Computer Science
Can someone explain to me the program step by step next to each statement in the program by using comment \\ and do the program using the basic c++ cuz down program looked messy advance?
a. Request a five-letter string value from the console.
b. If the input string is not a five-letter word, print that the word is not a five-letter word.
c. If the input string is a five-letter word,determine if the word is or is not a Palindrome. Hint: String indexes can be used to compare letter values.
d. If the word is a Palindrome, print that it is a Palindrome.
Output Example (input is bold and italicized)
Enter a five-letter word: test
test is not a five-letter word.
Output Example (input is bold and italicized)
Enter a five-letter word: kayak
kayak is a palindrome.
#include<bits/stdc++.h>
using namespace std;
int main()
{
char string1[10000], string2[10000];
int i, j, length = 0, flag = 0;
cout << "Enter a Five-letter word: ";
cin>>string1;
length = strlen(string1)-1;
if((length+1) == 5)
{
for (i = length, j = 0; i >= 0 ; i--, j++)
string2[j] = string1[i];
if (strcmp(string1, string2))
flag = 1;
if (flag == 1)
cout << string1 << " is not a palindrome.";
else
cout << string1 << " is a palindrome.";
}
else
{
cout< }
return 0;
}
In: Computer Science
IN PYTHON
1) Pig Latin
Write a function called igpay(word) that takes in a string word representing a word in English, and returns the word translated into Pig Latin. Pig Latin is a âlanguageâ in which English words are translated according to the following rules:
For any word that begins with one or more consonants: move the consonants to the end of the word and append the string âayâ.
For all other words, append the string âwayâ to the end.
For the above you can assume that âaâ, âeâ, âiâ, âoâ, and âuâ are vowels, and any other letter is a consonant. This does mean that âyâ is considered a consonant even in situations where it really shouldnât be.
For this exercise, you can assume the following:
There will be no punctuation.
All letters will be lowercase
Every word will have at least one vowel (so we wonât give you a word like âbyâ)
Write a helper function that finds the index of the first vowel in a given word, and use that in your main function.
Hints:
To find the index of the first vowel in a given word, since youâre interested in the indexes, looping through the indexes of the string using range, or enumerate, or a while loop may work better than a direct for loop on the characters.
Use slicing to break up the string into all of the letters before the vowel, and all of the letters from the vowel onwards.
Examples:
>>> igpay('can')
'ancay'
>>> igpay('answer')
'answerway'
>>> igpay('prepare')
'eparepray'
>>> igpay('synthesis')
'esissynthay'
In: Computer Science
Describe one instance where a word was used that has
different meanings in different contexts. It may be a word
that causes confusion, offends people, or is just misunderstood.
These types of works are usually connotative in
nature.
Please explain how the word was used within the
context of the situation. Give examples of how this word
might mean different things to different people.
In: Operations Management
Which of the following statements is leastcorrect?
| a. | The word âincurredâ is not defined in income tax legislation. | |
| b. | The word âincurredâ for tax purposes is associated with expenses. | |
| c. | Ordinary income is included in a taxpayerâs assessable income when it is derived. | |
| d. | The word âderivedâ for tax purposes is associated with income. | |
| e. | The word âderivedâ gets its meaning from income tax legislation. |
In: Accounting
In: Computer Science
(JAVA)
We will write a program to check the spelling of the word entered by user, using data from a dictionary, which is text file. The program will ask user to enter a word for spell check, and then check in the text file (dictionary.txt) if the word exists. (The dictionary.txt file is provided) If the word exists in text file, the output will be âWord is correctly spelledâ. If the word doesnât exist in the text file, program will write the message âWord doesnât exist in the Dictionaryâ and will request user to enter âyesâ or ânoâ to save the word in another text file. If user wants to write the word in a text file, user will enter âyesâ (This text file can be named anything, for example âPersonalDictionary.txtâ). Note: at this step, you need to write the word in the text file and display the message â****** is saved successfully in the fileâ (Asterisks denote the word entered by the user). If user doesnât want to write/save the word in the file, user will enter ânoâ and the program will display a message â****** is not stored in the fileâ (Where asterisks denote the word). After this, program will ask the user to enter another word or enter some key (for example: -1) to exit the program. The program will use âdictionary.txtâ file to read the list of words to be compared with. The program will create and write into a file (you can name it anything, for example âupdateDictionary.txtâ), the list of words that donât match.
1. (60 points) Program runs successfully
a. (10 points) Inputs word from the user using a Scanner object.
b. (10 points) Reads the dictionary text file and save the data in a variable
c. (10 points) Repeats until user exit the program (Using Sentinel value to stop)
d. (15 points) Writes the word into a new personal dictionary file
e. (15 points) Outputs the final summary correctly for spelling check
2. (40 points) Program contents follow readability standards including:
a. (10 points) Correct use of arrayLists or any other data type
b. (10 points) Successfully write and use a method outside of the main method
c. (10 points) Correct variable types with Useful, Camel-case identifiers and proper tabbing.
d. (10 points) Document your code with at least 5 helpful comments
i. Put comments above the lines of code they are documenting, not to the right
I cannot attach the dictionary.txt file i appologize
In: Computer Science
Using your language, write about the difference between the letter of credit and letter of guarantee
Word Limit for the assignment:
Upper word limit: 1200 words
Lower word limit: 600 words
In: Finance
Using your language, write about the difference between the letter of credit and letter of guarantee
Word Limit for the assignment:
Upper word limit: 1200 words
Lower word limit: 600 words
In: Accounting
In Java
A palindrome is a word or sequence of characters which reads the same backward and forward, such as madam, dad, racecar, 5885. In java Write a program that asks user to enter a word and prints if the word is a palindrome or not.
In: Computer Science