/CPlusPlus

C plus plus examples

Primary LanguageC++

CPlusPlus

C plus plus examples


Array Copy Elements.cpp

C++ Copy Array Elements By Using Pointer


Array Find Max Min.cpp

Write a function that finds the maximum and minimum elements in an integer array using pointers.


Array Reverses.cpp

Write a function that finds the maximum and minimum elements in an integer array using pointers.


Array Update Delete.cpp

C plus plus add array subtraction delete c ++ code


Cell Phone Invoice Calculator Program.cpp

Suppose that you are asked to develop a cell phone invoice calculator program. There are two types of tariffs for users: (1) the users that do not use any package are charged 0.15 TL/6 seconds (2) the 'eco' package users will pay 19 TL fixed fee for first 50 minutes and 0.2 TL/6 seconds for extra talking time that exceeds 50 minutes The program will get the total number of talking time in terms of minutes (double type) and then calculate and print the total amount that the user will pay for each tariff type. Write the C++ source code of the above program.


Fahrenheit to Calsius.cpp

Fahrenheit to Calsius translating program.


Program 2.cpp

Declare an integer array of size 50. Fill the elements of the array with random numbers between 120 and 300. Swap the successive two elements of the array. a[0] will be swapped with a[1], a[2] with a[3], a[4] with a[5], …., a[48] with a[49]. Display the elements of the array.


Recursive Function Example.cpp

Task1 Write a recursive function (use no while loops or for loops) that prints all the elements of an array of integers, one per line. The parameters to the function should be A (The array) and n (the size of the array). Task2 Find the sum of the integers from 1 through n. Use recursion.

Task1 = ArrayPrint function Task2 = calculateSum function


Structure Example.cpp

A. Reading and Displaying Data
The first part of your program will read some player information from a file, format the information, put it into an array of structures, and then display that array on the screen. Use the following formulas for the calculated values (points and shooting %) using a function:
Number of Points = Number of Goals Scored + Number of Assists
Shooting Percentage = Number of Goals Scored / Number of Shots Taken * 100
B. Saving Data


Structure Example 2.cpp

Define a function that calculates the average of the all grades (midterm 1, midterm 2 and final) of 5 students stored in a structure.


Sturcture Example 3.cpp

Define an employee structure to store employee’s name, surname and age respectively (using struct)


Time h Example.cpp

asctime() ve localtime() using


Tree Binary Search.cpp

Create binary search tree and add tree, delete, display. (push,pop,printf)


Tree Duplicate.cpp

The program creates 20 element arrays. These numbers are random. If it comes the same, it does not add up.They are duplicating them later. I did not install the tree creation code. Please use your own header file.


Txt Read.cpp

The file reads and display the screen.


Txt Write.cpp

The file writes and display the screen.