#include<iostream>
#include<fstream>
#include <ctype.h>
#include<sstream>
// #include<bits/stdc++>
using namespace std;
int main(){
int ctr=0;
ifstream fin;
fin.open("text.txt"); //opening the file
while(!fin.eof()){
string line;
getline(fin,line,'\n'); //getting
each line in the text file
if(ctr==0){
ctr++;
continue;
}else{
stringstream
ss(line);
string
word;
while(ss>>word){
if(word.length()<3){ //if word length is less
than 3 then we will skip the word and if it numeric then also we
skip it
if(isdigit(word.at(0))){
continue;
}
cout<<word<<"
";
}else{
int i=0;
int j=word.length()-1;
char
arr[word.length()-1];
arr[i]=word.at(0);
arr[j]=word.at(word.length()-1);
i++;
j--;
while(i<=j){ //reversing
the number from 1 and length -2 position as described in the
question
arr[i]=word.at(j);
arr[j]=word.at(i);
i++;
j--;
}
for(int
i=0;i<=sizeof(arr)/sizeof(arr[0]);i++){ //displaying each word
after reading it immediately
cout<<arr[i];
}
cout<<" ";
}
}
}
cout<<"\n";
}
fin.close(); //closing a file
return -1;
}
please write a C++ code Problem A: Word Shadow Source file: shadow.cpp f or java, or.cj...
Program Description: A Java program is to be created to produce Morse code. The Morse code assigns a series of dots and dashes to each letter of the alphabet, each digit, and a few special characters (such as period, comma, colon, and semicolon). In sound-oriented systems, the dot represents a short sound and the dash represents a long sound. Separation between words is indicated by a space, or, quite simply, the absence of a dot or dash. In a sound-oriented...
I dont understand how to solve these type of questions.
Q2. (25 marks) Write a C++ program that takes a sentence as input (type string) and returns what follows. Structure your program using functions. 1. The number of characters 2. The number of words in the sentence 3. The number of proper words (any word that starts with a capital letter except the first word) 4. The number of words that contain two consecutive letters (e.g., "letter”)
JAVA PROGRAMMING
(Game: hangman) Write a hangman game that randomly generates a
word and prompts the user to guess one letter at a time, as shown
in the sample run. Each letter in the word is displayed as an
asterisk. When the user makes a correct guess, the actual letter is
then displayed. When the user finishes a word, display the number
of misses and ask the user whether to continue to play with another
word. Declare an array to...
You are given a set of ABC cubes for kids (like the one shown below) and a word. On each side of each cube a letter is written 7 FI 0 You need to find out, whether it it possible to form a given word by the cubes For example, suppose that you have 5 cubes: B1: MXTUAS B2:OQATGE ВЗ: REwMNA B4: MBDFAC В5: IJKGDE (here for each cube the list of letters written on its sides is given) You...
Program Description: A C# app is to be created to produce Morse code. The Morse code assigns a series of dots and dashes to each letter of the alphabet, each digit, and a few special characters (such as period, comma, colon, and semicolon). In sound-oriented systems, the dot represents a short sound and the dash represents a long sound. Separation between words is indicated by a space, or, quite simply, the absence of a dot or dash. In a sound-oriented...
I need help writing this C code. Here is the description: Let's say we have a program called smart typing which does two things: The first letter of a word is always input manually by a keystroke. When a sequence of n letters has been typed: c1c2...cn and the set of words in the dictionary that start with that sequence also have c1c2...cnc then the smart typing displays c automatically. we would like to know, for each word in the dictionary,...
Use C++ and Visual Studio
Word Finder Version Your version of word finder should allow players to find as many words as they can from the list of letters. Name the cpp file called wordFinder LastNameFirstName.cpp. Words must contain at least 3 letters but no more than 6 letters The program must first read the words from a file but only can read in at most 5 words from a text file. The program should skip words that contains less...
Program is in C++. Write a function named wordStatsPlus that accepts as its parameter a string holding a file name, opens that file and reads its contents as a sequence of words, and produces a particular group of statistics about the input. You should report: the total number of lines; total number of words; the number of unique letters used from A-Z, case-insensitively, and its percentage of the 26-letter alphabet; the average number of words per line (as an un-rounded...
Program is in C++. Write a function named wordStatsPlus that accepts as its parameter a string holding a file name, opens that file and reads its contents as a sequence of words, and produces a particular group of statistics about the input. You should report: the total number of lines; total number of words; the number of unique letters used from A-Z, case-insensitively, and its percentage of the 26-letter alphabet; the average number of words per line (as an un-rounded...
Please Use C++ Language. Thank you. Please I need the actual code. Donot post psudocode!! And also I have codes but just donot work so make sure that it works. Requested files: CrosswordGenerator.cpp, CrosswordGenerator.h, CrosswordGenerator_test.cpp CrosswordGenerator - Write a program that helps to generate a crossword puzzle by organizing words that share letters. For this assignment, you will write a program that forms the basis of a crossword puzzle generator. In order to create a crossword puzzle you need to...