User Profile
Collapse
-
help plz? when i try to compile and run it exits. -
inputting array from file
Have a .txt document as:
String
int
int
int
int
int
int
int
int
int
int
String
int
int
...
for 15 strings. Looking to input the names into a string array then the grades into a 2d array Then output with some other calculations. Here is what i have so far:
#include <conio.h>
#include <iostream>... -
I think i need to use the s.find_first_no t_of but not sure how to incorporate.Leave a comment:
-
Splitting string into words and displaying
I need to Write a function that will, given an input string containing many words, split that string into individual words. For each word, the function should output the word, its starting index in the string, and its length to the console without using stream extraction operator.
#include <iostream>
#include <string>
using namespace std;
int main()
{
string sval = "... -
-
inputing data into 2d array and displaying
Have a program that is able to take the numbers out of the .txt if it is just a list of numbers. Problem is, I have a file with Names before the grades. I believe i need to set up another array inside the first one to fill with names. The .txt file will look like:
Name
grade
grade
grade
grade
grade
grade
grade
grade
grade
grade
Name
...
... -
Thanks for the input, i removed the two lines and now it displays every # as 2293668. Thought it might be an array index problem, but didnt see one anywhere.
ThanksLeave a comment:
-
the txt file is just a list of grades all on new lines
100
12
34
54
34
54
34
there are 15 students and 10 grades for each.Leave a comment:
-
.txt to 2d array
Trying to copy grades from a .txt file into a 2d array and display on screen, then find student average, class average, and average grade for each test. I can't get it to copy the grades over successfully. Here is what i have. Any help?
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <string>
... -
-
Thanks alot for the help. This is what i'm looking at now. The text is incorporated into the .txt file.I kinda understand what you're saying about inputing it into strings, but not sure how to code it so it will take the text.
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cmath>
using namespace std;
int main()
{
...Leave a comment:
-
inputing data into 2d array and displaying
Have a .txt with info listed as:
Name
Exam:
98
100
99
Quiz:
98
87
89
90
98
Project:
76
89
with 15 dif names. I need to put this data into a 2d array with students as the rows, and grades as columns and display it on screen. New to this still so bare with me.
#include <iostream>
#include...
No activity results to display
Show More
Leave a comment: