The Logo language, made the concept of turtle graphics famous. It was a mechanical turtle that walked around and drew shapes. The turtle holds a pen in one of two positions, up or down. While the...
Type: Posts; User: thomann061
The Logo language, made the concept of turtle graphics famous. It was a mechanical turtle that walked around and drew shapes. The turtle holds a pen in one of two positions, up or down. While the...
I finally figured out how to implement that. Thank you :)
Background:
I have to write a program that will read information from a file into a list and then display the list to the screen.
I am given the templated class and templated functions that...
In the first set (A), I have the elements of 1 as the low, and 8 as the high.
In the second set (B), I have the elements of 2 as the low, and 10 as the high.
For the operator && code below, it...
Background:
I have two templated classes, one derived from another. Both of them seperated out into header files and templated implementations. In my client_driver.cpp I am suppose to use the...
Okay, I understand. I will change them back.
New code:
// arrayi.t
#ifndef ARRAYI_H_
#define ARRAYI_H_
#include <iostream>
Thanks for the response.
There's something in the class I have to change?
Right now, I'm not sure as to what.
Why could I name the operation anything I want; don't I have to use A1 to access a...
Hello, I need help with templates. I have been very confused with calling them in the main(). I understand the general idea of templates and overloading functions, but actually doing it in c++ is...
PROBLEM STATEMENT:
Add a template to the arrayi.h class so that elements of the arrays can be integer, float or double. Also
add a subtraction operator to the class.
CODE:
Get the...
amazing, although i do not fully understand why.
This program is designed to allocate dynamic memory using pointers and sort them ascending and descending. The problem is it will not sort the pointers by value. For example if I enter -1 2 3 -6 8. ...
void countChars(ifstream& input, string storeCharacters[], ofstream& output)
{
int i = 0;
string line;
while( !input.eof() )
{
...
I will take note of that.
#include<iostream>
#include<fstream>
#include<iomanip>
#include<string>
#include<cstdlib>
usingnamespace std;
void getFileName(ifstream& input) //gets filename
{
It is counting the words fine.
#include<iostream>
#include<fstream>
#include<iomanip>
#include<string>
#include<cstdlib>
usingnamespace std;
void getFileName(ifstream& input)
{
The program runs fine, but it is not showing the characters being stored when I output them.
void countChars(ifstream& input, string storeCharacters[])
{
int i = 0;
int counter = 1;
for( i=0; i<counter; i++ )
{
getline(storeCharacters[i], input);
counter++;
if ( !input )
counter--;
So I still don't know how to read in the characters into an array.....
Yes we have learned structs, and classes.
You must use an array to store the information for each character.
You must have these functions in your code: (you may have others but not necessary)
getFileName – asks the user for the name...
Well, I thought I could use an array to store all the characters. If I used the getline() function to get each line individually, and then stored each line into an array.
I included the string in case I did use it. I'm not sure whether or not I need it.
a string array will suffice. I think 20 characters would cover the longest word.