Beginners - April 2020 (Page 2)

Exponent calculator issue
 
Write your question here. #include <iostream> using namespace std; int main() { //store base and total as double so we can get output for decimal bases ...
[5 replies] Last: double power( double base, int exponent ) { if ( exponent == ... (by lastchance)
"goto" statement
 
Use "goto" statement to return to the code marked above, and the marked "scanf" statement will not be executed again. How to solve this problem? I want "scanf" ...
[3 replies] Last: the marked "scanf" statement will not be executed again Oh it execut... (by dhayden)
how to make input on command line?
 
I am wondering how to make input on command line?
[6 replies] Last: I change my makefile. It now runs ok. Thank you for you help! (by Leen0093)
Nested class problem
 
I want to make methods inside hero class with dynamic memory allocation like initialization, adding, deleting objects, but compiler says that it cannot find dec...
[2 replies] Last: Thank you so much dhayden. That's helped me a lot. (by FJ39j39fs)
Help me pls
 
given a 2d array NxN. You can get N^2 values by adding elements from each row. Find the smallest N of these sums. you are allowed to use only one element from t...
[4 replies] Last: It was a silly addition to C99 using alloca() to do the allocation off... (by kbw)
Rain fall statistics problem
 
Hello all, I am doing a rainfall statistics problem, My issue is I am not sure how to link the array rain ; to the other functions. rain is the input of rain i...
[5 replies] Last: You try to do too many things at once. I would start simple. Just crea... (by thmm)
Infinite Array?
 
The instructions to construct this program require that : -Read an unknown amount of employees: last names, first names, employee IDs, job titles, hours worked...
[3 replies] Last: The instructions say to use arrays: use arrays. Remember, unknown num... (by Duthomhas)
C++ Exercise
 
Hi everyone, I am in the fourth year of high school and I'm working on a program in C ++, which mixes the electrical circuits of physics with C ++. the delivery...
[17 replies] Last: so the operation that should be done is to move the part of the total ... (by matthew8810)
Introduction to Inheritance Using Shapes
 
Hi all, I am taking an Intro to C++ class and we just started learning about inheritance. One of our assignments asks us to make a program that has the user inp...
[1 reply] : My main confusion is how the setup function will know which shape I w... (by Repeater)
sorting txt.file
 
i need to sort a text file (it could be increasing or decreasing) years. the text file includes #of entries nameofwar: year\n how can I sort the text fil...
[3 replies] Last: how can I sort the text file with out the use of vectors, algorithms.... (by George P)
input streams/ print specific parts of txt file
 
so I was given an input file where they gave me the following information #ofentries fruitname:color, length, width, vitamins\n. I need to run a program tha...
[3 replies] Last: Can a fruit contain more than one vitamin? What does that look like in... (by dhayden)
sequental search cin is not working
 
Write your question here. why it's not working correct. cin is not working #include <iostream> using namespace std; const int LEN = 10; int arr =...
[2 replies] Last: You never change i inside the loop, so it loops forever with i==0. T... (by dhayden)
Error: Expected unqualified-id fix
 
I Don't know what's wrong with this. I've tried a lot of things, but never got it to work. Can anybody help me? #include<iostream> using namespace std;...
[2 replies] Last: int main(); <------- that ; tells the c++ compiler that somewhere lat... (by jonnin)
Find largest 3 max numbers
 
Hello all, I am running a code to find 3 largest numbers in an array. I got the hang of the first 2 but for some reason the third number is equal to itself. ...
[9 replies] Last: #include <iostream> #include <set> using namespace std; template <ty... (by lastchance)
HELP CODING TICHU
 
Do you have an actual question?
[1 reply] : > no i dont know how to get start How did you start(*) every other pr... (by salem c)
Help me pls
 
given a 2d array NxN. You can get N^2 values by adding elements from each row. Find the smallest N of these sums. you are allowed to use only one element from t...
[4 replies] Last: Duplicate: https://www.cplusplus.com/forum/beginner/269993/ (by George P)
Undefined reference to Function in header file
 
I have two .cpp files one is main1.cpp and second main2.cpp. I have function on main2.cpp which I am calling on main1.cpp via header file named main2.h. I a...
[4 replies] Last: Maybe you need to add main2.cpp to the project. Project->Add files (by thmm)
which is of non-class type
 
Hi guys please help me, why in blj.sub and blj.hrg error which is of non-class type ? struct data{ int jumlah ; int hrg ; int sub ; char barang ; i...
[6 replies] Last: Since all the parts of your struct are arrays you should read this tut... (by thmm)
by mk7mew
Homework assignment [Help]
 
Was wondering how -I can add function to get the student name with the a string -add a function to assign a letter grade called from Main then the letter gr...
[1 reply] : -I can add function to get the student name with the a string Seems... (by Ganado)
How do I find the common prefix in strings?
 
Hi guys! My assignment asks to find the common prefixes from user input, for example, user input -- "tiger" "teacup" "time" output : user inputs 3 strings a...
[11 replies] Last: Thanks @dutch! We also need a test to ensure that the initial prefix ... (by mbozzi)
April 2020 Pages: 1234... 20
  Archived months: [mar2020] [may2020]

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