Beginners - November 2014 (Page 56)

2 Dimensional Arrays HELP URGENT!!
 
See this program is used to enter 3 marks of 4 students and calculate their grade with their averages. Now the problem is as soon as it go to enter the 3rd mar...
[3 replies] Last: #include<iostream> int main() { using namespace std; int i,j,k,av,s=0... (by anup30)
How to reverse the letters of all the words only, not of the full string?
 
I want to reverse the letters of all the words only, not the full string. For example: Input: You are Mike. Output: uoY era .ekiM How to do this using...
[2 replies] Last: using stringstream, #include <iostream> #include <sstream> using na... (by anup30)
Make x value depending on the number of words
 
Alright, so I don't really know how to explain this, so I'll do my best; I want the user to write some words separated by a comma and a space, and then I want t...
[7 replies] Last: I just have. I hope :) (by mutexe)
Need help!
 
for this I need to it to also show the square inches. for both of the valid entries. ok I have it for the square inches of the diameter. #include<iostream> #i...
[3 replies] Last: I tried that and it worked great. (by nichan79)
book for c++ modelling
 
Hi all, Have you ever seen a book that contains sample c++ codes by which a physical phenomena have been modelled. for example particles movement in side a flu...
[no replies]
by alkass
Call a constructor after created a copy of the Class
 
Hi I am a newbie, so I am trying to do something like MyDigi Digitizer;MyDigi.Reset(); The Reset() class actually sets some default values. Now, I want to...
[1 reply] : struct Digitiser { Digitiser( float var1_, float var2_ ) { /* ...... (by JLBorges)
Output Problem
 
I want to check if a char is one of the letters in a word(string), so I wrote like this: for (int i = 0; i < word.length(); i++) { if(letterForScan == wor...
[3 replies] Last: int b = 0; for (int i = 0; i < word.length(); i++) { if(letterFo... (by anup30)
Errors in code snippet
 
Hello, I have the following homework problem to answer. We have just started looking at classes. This class definition (header file) has 5 errors. Identif...
[4 replies] Last: Thank you, these suggestions were helpful. (by maximus123)
Console I/O in C++
 
"C originally left I/O to compiler implementers. One reason for this was to give implementers the freedom to design I/O functions that best fit the hardware req...
[2 replies] Last: It means what is says. In the early days of computers did not have a... (by YokoTsuno)
by bhalo
how to delete dynamic objects
 
// #include <iostream> using namespace std; class node { private: public: int data; node *next; node(int d, node *p): data(d), next(p){} }; int main() {...
[1 reply] : The simplest way is to use C++'s own linked lists. Since you have null... (by Cubbi)
by amizam
im new in function, can u find my error?
 
Why is my input ask the user to enter the score twice? #include<iostream> using namespace std; void getScore(int&); void printGrade(int); int main() {...
[3 replies] Last: You're welcome - glad it worked out :) (by MikeyBoy)
Problem about extract individual digits argolithm
 
I have an exercise which asks me to write a program that input an integer then output the individual digits of the number and the sum of digits. E.g: 1506 -> 1 ...
[2 replies] Last: Wow, I got it. Finally, it works. Thank you so much. (by quan1506)
loop
 
char selection = '0'; int player_hp = 100; int enemy_hp = 100; for ( ; player_hp <= 0 || enemy_hp <= 0 ; ) { cout << " Attack Run" << endl; selection = _getch...
[2 replies] Last: Use a do{}while. That's executed at least once. (by YokoTsuno)
Problem with constructors
 
In the following code, what does it mean to put node*q=0; . I mean node constructor requires two parameters right? Also please explain how the code works...
[3 replies] Last: "I mean node constructor requires two parameters right?" Yes. It's c... (by YokoTsuno)
Diamond Project
 
Okay the goal is to make output a diamond like this -----* ----*** ---***** --******* -********* *********** -********* --******* ---***** ----*** ...
[2 replies] Last: Question 1: You can use the manipulator setw() form the <iomanip> libr... (by quan1506)
by Jhub
Array Problems
 
I am trying to write a program that uses the randFloat function to generate two sequences of 500 points. Each sequence should have a theoretical mean of 4, but...
[1 reply] : How about http://www.cplusplus.com/reference/random/normal_distributio... (by keskiverto)
Identifying prime numbers inputted 10 numbers
 
I'm sorry if i'm too active here D: Well, our professor asks us to input ten numbers and the program must output/identify the prime numbers in the given input...
[1 reply] : 1. Use a loop to get 10 numbers. 2. Restructure your code. Create fu... (by keskiverto)
Template problem
 
Im getting errors at line 32 saying expected class name, and another error at line 53 saying use of class b requires template argument. How can i Fix this? ...
[1 reply] : Line 15 should return a while 38 should return b. B obj;///line 57 c... (by closed account SECMoG1T)
Passing arrays
 
When i call maxFunc and pass the array from the file it wont let me pass in the values. Why? /* Let A be an array of n elements. Write a template function,...
[2 replies] Last: I dont understand, how can i rewrite it. (by Rashad2)
What's the code?
 
This is the output: https://app.box.com/s/xsncghj8zetyeq4a04fb >The third part: Input width and height and it gives a pattern of diamonds #include<iostre...
[8 replies] Last: @whitenite1 Thank you! :) (by Vandalism)
November 2014 Pages: 1... 5455565758... 65
  Archived months: [oct2014] [dec2014]

This is an archived page. To post a new message, go to the current page.