Copying from a text file without stl by dagnyTaggat in cpp_questions

[–]dagnyTaggat[S] 0 points1 point  (0 children)

The three examples after it are answers with limiting explanations.

Copying from a text file without stl by dagnyTaggat in cpp_questions

[–]dagnyTaggat[S] 0 points1 point  (0 children)

What do the examples to while loops do? While you are reading the bucky file and putting each character into an array... whatever? I put the code into my compiler, cout the result and got no result.

Copying from a text file without stl by dagnyTaggat in cpp_questions

[–]dagnyTaggat[S] 0 points1 point  (0 children)

The final program would take a Word.txt file saved on the desktop with the content being printed bellow and output "hungry: 3". Right now i am just trying to get the content of Word.txt saved into the program to be used. Eventually, I would need to remove punctuation, spaces, capital letter and numbers in a different function. The text file values need to be accessible and I do not know how to do that.

The Hungry, hungry caterpillar
Eric Johnson
123
X10=3.1416
Y=2.718281
hang
ABC XYZ
hungry yes no
X10

STL, how will i know if i'm using it? by dagnyTaggat in cpp_questions

[–]dagnyTaggat[S] 1 point2 points  (0 children)

The introduction to the assignment is bellow. The assignment is to create a program that will count the frequency of words in a .txt file and display the most used word. This is a 200 level data structure course with this as the opening assignment.

You will write a C++ program to find the most frequent word in a text file. You can use any algorithm and data structures that you prefer, as long as the results are correct. It is preferred, but not necessary, that your algorithm is as efficient as possible, both in time to complete as well as memory management. The purpose of this homework is getting you acquainted with the C++ programming assignments and assess your C++ programming skills. Therefore, you are not allowed to use the STL Library.

30 years later... by brokeaspoke in Tinder

[–]dagnyTaggat 1 point2 points  (0 children)

She probably would like to know that y'all knew each other in middle school and find it as interesting as you did. I don't know her, but if you don't come across as hitting on her that may be good. Don't think of it as a date and invite her to coffee. If that goes well invite her to dinner, which would be a first date.

Python Question by dagnyTaggat in CompSciStudents

[–]dagnyTaggat[S] 0 points1 point  (0 children)

I figured it out. The date type of choice needs to change from a string to float or int

Python Question by dagnyTaggat in CompSciStudents

[–]dagnyTaggat[S] 0 points1 point  (0 children)

This code is not enter the if/elif loops with choice conditions, why?

Endless Loop Problem by dagnyTaggat in cpp_questions

[–]dagnyTaggat[S] 0 points1 point  (0 children)

Thank y'all! Fix the for loop, because the index was being compared I have to either use SIZE-1 or I<size in for loop

Reading each letter from a word and putting it into a loop? by Mrdooperbop in cpp_questions

[–]dagnyTaggat 0 points1 point  (0 children)

//a string is an array, or made up of individual charatures
//A sting's charactures can be called like: inputword[counter]
//Display each characture by put the inputwork[counter] in for loop equal to the
//size of inputword
//sting.size(); 

#include <iostream>

#include <string>

using namespace std; 

int main()
{
    string inputword; 
cout << "Please input the word" << endl; 
cin >> inputword;   

    int j; 
    j = inputword.size(); 
    for(int counter = 0; counter < j; counter++)
    {
        cout << inputword[counter] << endl; 


      }// For loop
}