Beginners - March 2017 (Page 13)

Tic-tac-toe
 
So I made a tic-tac-toe game because thats what everyone does when they start out. I wanted to share it so I copied it into code playground @ sololearn. Proble...
[no replies]
tax calculator help
 
Hello. I am trying to write a program that calculates tax incrementally. The first 30000$ of income is not taxed. 30,000.01 to 50,000.00 is taxed 10% and so on....
[1 reply] : Try running the program in a terminal window. It runs okay for me. H... (by dhayden)
by kaffy
finite element analysi
 
hi..I am doing a project on finite element analysis..A framework is provided to me but i have no clue what is going on in this code??Can anyone explain this pro...
[1 reply] : @kaffy This may be a case of "can't see the wood for the trees". What... (by lastchance)
SDL2 clearing screen question.
 
Hi. I just have a basic question In my app screenMain loads with for for instance button A and button B. Button A loads screenA , button B loads screen...
[1 reply] : SDL2 doesn't support buttons. This means you've rolled your own butto... (by mbozzi)
Need help allowing user to take a quiz.
 
Hi, I have a program I have been building to allow a user to take a quiz. Up until now I have only been load the quiz from a file and display everything. Now I ...
[2 replies] Last: //continuing on below: int menu() { int selection = 0; std::cout... (by pleaseINeedHelp)
by ahogan
Random Number Bubble Sort
 
Hi, I am new to this still getting the hang of the language. I am trying to write a code that uses the bubble method to sort 20 randomly generated number (numbe...
[3 replies] Last: #include <cstdlib> #include <ctime> #include <iostream> void print_a... (by JLBorges)
remove digit of an integer from left to right
 
hello, I'm trying to write a code that would remove the digit of an integer from left to right. For example, 123 to 23 then 3 or 3202 to 202. n = n % (i...
[1 reply] : unsigned int remove_left_most_digit( unsigned int n ) { if( n < 1... (by JLBorges)
by ahogan
Random Number Output of MEan and SD
 
I thought I had this code correct for the most part, I get an error at the main. The code is supposed to allow users to input an array size from that size rando...
[2 replies] Last: Thank you, got it (by ahogan)
CTIME and how to use it properly
 
Hello ya'll. Can someone show me the best way to implement ctime here? Super lost! #include <iostream> #include <ctime> using namespace std; int main()...
[3 replies] Last: Gunner, JL; This is exactly what I was looking for - thank you so ve... (by shycas2008)
what is a class? what does a class do? What is a constructor?
 
In the beginning before we knew what class was we used to make our functions seperately. Making a class does it group all my functions together and thats it?...
[2 replies] Last: a class is a user defined variable type. Roughly, it is a way to grou... (by jonnin)
Writing a switch statement with two random numbers
 
I am confused because i have to use two numbers between 1 and 100 that corresponds with a bunch of statements. For example the statements i have to use are "The...
[1 reply] : the first number is always divisible by the first number. The answer... (by jonnin)
Finding Duplicates in Vectors
 
Hey so right now i am having trouble with trying to find duplicate numbers of decimals in a vector here is an example of what i am looking for 6.578947 The n...
[2 replies] Last: the standard approach is to sort the data, or a copy of it, and compar... (by jonnin)
if array is more than 10
 
lets say the size of the array is 50 i just want to print the last 10 40-49
[3 replies] Last: Not sure what you're trying to do here. What exactly are you trying to... (by kingkush)
how do i load the array with primes and print
 
rules - if the array size is 100 or more print last 100 element #include <iostream> #include <cmath> #include <iomanip> using namespace std; in...
[no replies]
by VX0726
Probability Of Winning Is Zero?!
 
My program is supposed to simulate a specific number of games of craps "Pass Line" bets (I'm not kidding, it's called craps) and then display the number of wins...
[1 reply] : In c++ division on whole numbers returns a whole number, e.g 5/2 = 2. ... (by TheHardew)
If and else statement run, not just if.
 
When I run this code and enter in a statement that makes the "if" statement true, it runs the if statement and the else statement and not just the if statement ...
[3 replies] Last: Glad I could help! (by kingkush)
Need to use one parameter to give values to multiple variables
 
Write your question here. I need to use a single parameter in doOneSet to give values to three differnt variables in int mainn to send to printReport so the ...
[1 reply] : I think you might be confused. Your function is taking in 3 arguments.... (by kingkush)
Check for Prime Numbers - C++
 
Personal Contribution. Just a quick question, 1 is not considered prime number, right ? #include <iostream> #include <vector> #include <limits> using namesp...
[3 replies] Last: @TheHardew, right on! Both sample codeshave this bug, I have to fix it... (by Kourosh23)
Trouble with reading/writing integer data to/from binary file
 
I'm completing an assignment that involves writing an array of integer data to a binary file, then reading the integer data from that binary file back into an a...
[2 replies] Last: Thomas, you rock. Not only did this help me see the bug, it also help... (by mastakhan)
How to dynamically allocate space for an "incomplete" matrix?
 
Hello. I'm having an issue with the function below. It is a function that takes as argument a dynamically allocated diagonal matrix, along with its respective n...
[4 replies] Last: But every diagonal matrix is ​​a square matrix, but not every squ... (by lastchance)
March 2017 Pages: 1... 1112131415... 36
  Archived months: [feb2017] [apr2017]

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