This Post has some Previous Posts, you can access the first Main Post here: Some C++ Problems for Beginners (1) The code was written and tested on Visual Studio 2010 –> “Empty Windows Console Application” . if you don’t have Visual Studio, you can get the latest version from : -Visual C++ 2010 Express: http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express note that, you can also use another IDEs like: -Visual Studio Express 2012 for Windows Desktop: http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products#product-express-summary -CodeBlocks: http://sourceforge.net/projects/codeblocks -GNU C++ compiler GCC(g++): http://gcc.gnu.org/ -MingW GCC port for windows: http://www.mingw.org/ -C++ Builder (Borland): http://www.embarcadero.com/products/cbuilder -2DimArrayFrom1DimArray.cpp: Problem Definition: Supposing that you have the following 1 Dimensional Array called A as a known input: int A[10] = {1,1,2,5,3,4,9,8,7,1}; Fill the Char Array B (char B [10][10]) with the Histogram values taken from the Array A then Print the Histogram in B ================================================ output: ------- * * ** ***** *** **** ********* ******** ******* * ================================================
download the 2DimArrayFrom1DimArray.cpp (Commented, Explained Code) | |||||
Download all the C++ Simples I’ve created : C++ Problems |
Monday, June 3, 2013
Some C++ Problems for Beginners (7)
Some C++ Problems for Beginners (6)
This Post has some Previous Posts, you can access the first Main Post here: Some C++ Problems for Beginners (1) The code was written and tested on Visual Studio 2010 –> “Empty Windows Console Application” . if you don’t have Visual Studio, you can get the latest version from : -Visual C++ 2010 Express: http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express note that, you can also use another IDEs like: -Visual Studio Express 2012 for Windows Desktop: http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products#product-express-summary -CodeBlocks: http://sourceforge.net/projects/codeblocks -GNU C++ compiler GCC(g++): http://gcc.gnu.org/ -MingW GCC port for windows: http://www.mingw.org/ -C++ Builder (Borland): http://www.embarcadero.com/products/cbuilder -TwoDimArray.cpp: Problem Definition: Write a code fragment that construct a two-dimensional array (name it B) of integers with 5 rows and 5 columns. Then: -Fill-in the array B to contain the multiplication table from 1 to 5 -Find the sum of the numbers for each row -Find the sum of all numbers in the array
download the TwoDimArray.cpp (Commented, Explained Code) | |||||
Download all the C++ Simples I’ve created : C++ Problems |
Some C++ Problems for Beginners (5)
This Post has some Previous Posts, you can access the first Main Post here: Some C++ Problems for Beginners (1) The code was written and tested on Visual Studio 2010 –> “Empty Windows Console Application” . if you don’t have Visual Studio, you can get the latest version from : -Visual C++ 2010 Express: http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express note that, you can also use another IDEs like: -Visual Studio Express 2012 for Windows Desktop: http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products#product-express-summary -CodeBlocks: http://sourceforge.net/projects/codeblocks -GNU C++ compiler GCC(g++): http://gcc.gnu.org/ -MingW GCC port for windows: http://www.mingw.org/ -C++ Builder (Borland): http://www.embarcadero.com/products/cbuilder -ShapesAreas.cpp: Problem Definition: Write a program that take from the user "1" if Circle, "2" if Rectangle, "3" if Triangle, "4" if Square & "5" if Parallelogram then Calculate and Print the Area of the chosen Shape after taking the inputs from the user. Note: Area of a: Circle = π × r2 (read r from the user and consider that π = 3.14) Rectangle = w x h (read w and h from the user) Triangle = 1/2 base x h (read base and h from the user) Square = L2 (read L from the user) Parallelogram = base * h (read base and h from the user)
download the ShapesAreas.cpp (Commented, Explained Code) | |||||
Download all the C++ Simples I’ve created : C++ Problems |
Some C++ Problems for Beginners (4)
This Post has some Previous Posts, you can access the first Main Post here: Some C++ Problems for Beginners (1) The code was written and tested on Visual Studio 2010 –> “Empty Windows Console Application” . if you don’t have Visual Studio, you can get the latest version from : -Visual C++ 2010 Express: http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express note that, you can also use another IDEs like: -Visual Studio Express 2012 for Windows Desktop: http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products#product-express-summary -CodeBlocks: http://sourceforge.net/projects/codeblocks -GNU C++ compiler GCC(g++): http://gcc.gnu.org/ -MingW GCC port for windows: http://www.mingw.org/ -C++ Builder (Borland): http://www.embarcadero.com/products/cbuilder -ZeroSmaller.cpp: Problem Definition: Write a function called ZeroSmaller() that is passed three int arguments by reference and then sets the smaller of the three numbers to "0"
download the ZeroSmaller.cpp (Commented, Explained Code) | |||||
Download all the C++ Simples I’ve created : C++ Problems |
Some C++ Problems for Beginners (3)
This Post has some Previous Posts, you can access the first Main Post here: Some C++ Problems for Beginners (1) The code was written and tested on Visual Studio 2010 –> “Empty Windows Console Application” . if you don’t have Visual Studio, you can get the latest version from : -Visual C++ 2010 Express: http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express note that, you can also use another IDEs like: -Visual Studio Express 2012 for Windows Desktop: http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express note that, you can also use another IDEs like: -Visual Studio Express 2012 for Windows Desktop: http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products#product-express-summary -CodeBlocks: http://sourceforge.net/projects/codeblocks -GNU C++ compiler GCC(g++): http://gcc.gnu.org/ -MingW GCC port for windows: http://www.mingw.org/ -C++ Builder (Borland): http://www.embarcadero.com/products/cbuilder -EquationProblem.cpp: Problem Definition: Without Using MATH.h write a program that can solve the following equation and Display "R" on the screen R = X^Y + Y^Z - (X + Y)^2
download the EquationProblem.cpp (Commented, Explained Code) | |||||
Download all the C++ Simples I’ve created : C++ Problems |
Some C++ Problems for Beginners (1)
Yesterday, I’ve decided to write some simple C++ programs to help beginners to know how to write some code; The code was written and tested on Visual Studio 2010 –> “Empty Windows Console Application” . if you don’t have Visual Studio, you can get the latest version from : -Visual C++ 2010 Express: http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express note that, you can also use another IDEs like: -Visual Studio Express 2012 for Windows Desktop: http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products#product-express-summary -CodeBlocks: http://sourceforge.net/projects/codeblocks -GNU C++ compiler GCC(g++): http://gcc.gnu.org/ -MingW GCC port for windows: http://www.mingw.org/ -C++ Builder (Borland): http://www.embarcadero.com/products/cbuilder 1. –DynamicStars.cpp: Problem Definition: Write a Program that Dynamically draw Stars * from "N" entered by the User to 1 e.g. Input: 3 Output: *** ** *
download the DynamicStars.cpp (Commented, Explained Code) | |||||
Download all the C++ Simples I’ve created : C++ Problems |
Some C++ Problems for Beginners (2)
This Post has some Previous Posts, you can access the first Main Post here: Some C++ Problems for Beginners (1) The code was written and tested on Visual Studio 2010 –> “Empty Windows Console Application” . if you don’t have Visual Studio, you can get the latest version from : -Visual C++ 2010 Express: http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express note that, you can also use another IDEs like: -Visual Studio Express 2012 for Windows Desktop: http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products#product-express-summary -CodeBlocks: http://sourceforge.net/projects/codeblocks -GNU C++ compiler GCC(g++): http://gcc.gnu.org/ -MingW GCC port for windows: http://www.mingw.org/ -C++ Builder (Borland): http://www.embarcadero.com/products/cbuilder 1. -AlphabeticalModulus.cpp: Problem Definition: Write a Program that read 2 Numbers from the user X & Y where 1<= Y <= 9 (if Y is not in the specified range terminate the program) Print R = X % Y (R = X Modulus Y) in English Letters e.g. if R = 5 --> Print "Five" note: R will always be a value between 0 and 9
download the AlphabeticalModulus.cpp (Commented, Explained Code) | |||||
Download all the C++ Simples I’ve created : C++ Problems |
Subscribe to:
Posts (Atom)