Beginners - January 2018 (Page 8)

Random Numbers
 
Hi there. I am currently writing a basic fruit machine in C++. At the moment it's a simple text based machine that will spin in numbers (either 1, 2, or 3) a...
[2 replies] Last: alternately you can roll 15 results at once ahead of time and store th... (by jonnin)
by dubley
outputting values from class
 
Hello, in this program, when I output total_val I get 0, when it should be 500 and 21. I can get the program to work if I write an external function but not whe...
[8 replies] Last: Hi, I got it working in the style of the original program. Thank you v... (by dubley)
by KNery
Function that reads text file using fstream parameter passed by reference
 
Homework assignment Separate existing code into functions first function must be{ "A function named readInput that returns a string containing the message...
[2 replies] Last: A function named readInput that returns a string containing the messa... (by Hengry)
How to set default values through a function?
 
hi! I want to check if values have been set from the command line and if not set them to a default value. /*...*/ //->this function is meant to ...
[2 replies] Last: Hello Rdanutalexandru, In addition to what jonnin said remember at it... (by Handy Andy)
Homework help with integers.
 
Hi! my professor gave us this assignment without really instructing us on how it's done. I have a small idea of how it goes but I was wondering if someone could...
[2 replies] Last: Hello marygamess, Welcome to the forum. And if you are unfamiliar wi... (by Handy Andy)
Need help.
 
I was told to make a 2 dimensional array program that get its highest/maximum number. When I try to run this code it gives me random number. #include <io...
[7 replies] Last: [quote=Newbie992]Can you explain what does this line do? In this ins... (by lastchance)
Why do I have to pass by reference?
 
Hi! Currently I'm reading a book on algorithms and recursion and so far I think I'm getting better.But I wanted to test my skills so I tried to parse a simp...
[3 replies] Last: Thank you and about the *some-- I forgot to remove it when pasting it ... (by stonedviper)
by ebba
How to make this better (HW)
 
I'm working on this assignment. Part one was to create a program that could do basic calculations with simple fractions (+,-,*,/). Part 2 is to create a program...
[1 reply] : Hello ebba, In your third bit of code that combines the two programs ... (by Handy Andy)
how to change this to if...else statement c++
 
cashRegister counter; dispenserType candy(500, 50); dispenserType chips(100, 65); dispenserType gum(75, 45); dispenserType cookies(100, 85); i...
[2 replies] Last: thnx (by closed account 3p4G8vqX)
URGENT HELP NEEDED Pt2!!!
 
Hi so this is another part to the "URGENT HELP NEEDED!" post I made yesterday. I figured out how to do everything in regards to sorting single parallel arrays a...
[2 replies] Last: I appreciate the clarification fiji885, however how would this look li... (by nakul27)
Printing sparse matrix
 
Hello all, currently working on a project which requires me to print a grid of numbers. The data that will be stored is in 2 separate variables of rows and colu...
[1 reply] : shouldn't oneItem have a value field? youll want to sort your array o... (by jonnin)
by exru
What the best way to store data in Model?
 
Hi all! I'm a php developer with 7 yeas experience. I know a little c++\qt, but i need some help. I want to combine some libraries like: pqxx, jsoncpp. It will...
[2 replies] Last: Shouldn't actually the model be responsible to get and set values in t... (by Thomas1965)
by Vinz24
convert number to words using irritation
 
How to convert numbers to word using irritation? Here's the source code that convert num to words but it uses if.. else statement. i want to use an iteration me...
[6 replies] Last: #include <iostream> #include <string> using namespace std; const str... (by lastchance)
by Joe C
Help with Factorial
 
I'm trying to do the following exercise from Programming: Principles and Practices Using C++ 2Ed. Ch6 Ex3 Add a factorial operator: use a suffix '!' opera...
[2 replies] Last: Thanks for the reply. I was out of town (and away from my computer) f... (by Joe C)
by jly
Birthday Paradox loop question
 
Hello everyone, I'm trying to understand this loop that simulates the number of trials in the birthday paradox and compares the birthdays. What I don't underst...
[3 replies] Last: I honestly have not studied the problem and its solutions. I simply s... (by jonnin)
Need help. Thanks
 
Okay so I was told to make a program to enter how many students then calculating its average using function with the array in it. The problem with this is the ...
[2 replies] Last: Thanks Repeater I made it to cout<<"The average of the class is "<<c_... (by Newbie992)
Question on headers
 
In the coding below, the copy statement works without #include <algorithm> being specified. I also notice this in another program that initializer_list cou...
[4 replies] Last: You're welcome - glad I could help. (by MikeyBoy)
Need help in every combination program
 
Hi I have a every combination program, it's working fine but i've got one problem. I want to have program which gives me every combination of let's say 10 lett...
[3 replies] Last: #include <iostream> #include <string> using namespace std; const str... (by lastchance)
URGENT HELP NEEDED!
 
Hi, thank you for the help in advance. I have this project in C++ for AP Computer Science (I know that this isn't generally part of the curriculum, but our teac...
[14 replies] Last: Ok, so I figured out how to do multiple parallel arrays, however I am ... (by nakul27)
by sambix
Need help aligning my output
 
This is my output. For some reason Gear-Housing and Vacuum-Gripper are not aligning their values 5 and 25. What am i doing wrong? I copy pasted my code at the e...
[3 replies] Last: Hello sambix, PLEASE ALWAYS USE CODE TAGS (the <> formatting button) ... (by Handy Andy)
January 2018 Pages: 1... 678910... 22
  Archived months: [dec2017] [feb2018]

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