Sunday, December 26, 2021

Sum of Digits Using While Loop Statement in C

 Machine Problem

Design a program that will ask the user to give a number and then the program will compute the sum of all the digits of the given number using while loop statement.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Program Listing


/* Problem No. 1


Design a program that will ask the user to give a number and then the program will compute the sum of all the digits of the given number using while loop statement.


Solution


sum_digits.c

 Author   : Jake Rodriguez Pomperada, MAED-IT, MIT

 Science Research Specialist II Technological University of the Philippines Visayas

 Address  : Capt. Sabi Street, Talisay City, Negros Occidental, Philippines

 Email    : jakerpomperada@gmail.com

 Tool     : Dev C++ Version 5.11

 Date     : December 25, 2021   9:46 PM Saturday

*/


#include <stdio.h>


int main()

{

    long int num=0, r=0, sum=0;

    printf("\n\n");

    printf("\tSum of Digits Using While Loop Statement in C");

printf("\n\n");

printf("\tGive a Number : ");

scanf("%d",&num);

    sum = 0;

    while (num !=0){

    r = num % 10;

    sum+=r;

    num/=10;

}

    printf("\n");

    printf("\tThe total sum of the digits is %d.",sum);

    printf("\n\n");

    printf("\t\t End of Program");

    printf("\n\n");

}


Friday, December 24, 2021

Square and Cube Root of the Number Using Functions in C++

Square and Cube Root of the Number Using Functions in C++

 I wrote this program to ask the user to give five numbers and then the program will compute the square and cube root value of the given five numbers using one-dimensional arrays using functions in C++ programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.




Program Listing

#include <iostream>

#include <iomanip>


using namespace std;


int square(int val[5])

{

    cout << "\n\n";

    cout << "Value" << setw(8) << "SQUARE"

    << setw(12) << "CUBE ROOT";

        cout << "\n";

  for (int v=0; v<5; v++){

      cout <<"\n" <<setw(2) << v[val]

          << setw(8) << v[val] * v[val]

         << setw(12) << v[val] * v[val] * v[val];

      }

}


main() {


int x[5];

   cout << "\tSquare and Cube Root of the Number Using Functions in C++";

   cout << "\n\n";

   for (int list=0; list <5; list++) {

       cout << "Enter a Number : " ;

       cin >> list[x];

       }

        square(x);

cout << "\n\n";

system("PAUSE");

}

Thursday, December 23, 2021

Addition and Division of Two Numbers in Java

Addition and Division of Two Numbers in Java

 A simple program that I wrote using Java programming language to ask the user to give two numbers and then the program will compute the sum and division of two numbers and display the results on the screen.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Program Listing

import java.util.Scanner;


public class Addition_Division {


public static void main(String[] args) {

   int val1=0,val2=0;

   

Scanner input_val= new Scanner(System.in);

  System.out.println("\n");

  System.out.println("\tAddition and Division of Two Numbers in Java");

  System.out.println("\n");

      System.out.print("\tEnter the first number  : ");

      val1=input_val.nextInt();

      System.out.print("\tEnter the second number : ");

      val2=input_val.nextInt();

      

        System.out.println("\n");

      System.out.println("\t" + val1 + " + " + val2 + " = " +  (val1 + val2));

      System.out.println("\t"+val1 + " / " + val2 + " = " +      (val1 / val2));

      System.out.println("\n");

  System.out.println("\tEnd of Program");

  System.out.println("\n");

  input_val.close();

}


}

Our Mother 80th Birthday

Wednesday, December 22, 2021

Add Record in the Database in Microsoft Visual FoxPro

Add Record in the Database in Microsoft Visual FoxPro

 A simple program that I wrote to add record in the database in Microsoft Visual FoxPro programming.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Program Listing


Save Button


INSERT INTO product_info (product,quantity,price);

 values(UPPER(thisform.txtProduct.value),VAL(thisform.txtQuantity.value),VAL(thisform.txtPrice.value))

MESSAGEBOX("Record has been saved in the database.")

CLOSE DATABASES



Tuesday, December 21, 2021

Student Grade Solver in Visual FoxPro

Student Grade Solver in Visual FoxPro

 A simple student grade solver that I wrote using Microsoft Visual FoxPro.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Program Listing

Compute Grade Button

prelim = val(thisform.txtPrelim.value) * 0.20 midterm = val(thisform.txtMidterm.value) * 0.30 endterm = val(thisform.txtEndTerm.value) * 0.50 final_grade = (prelim + midterm + endterm) thisform.TxtFinalGrade.Value = STR(final_grade,2)

Clear Grades Button

thisform.txtPrelim.value = "" thisform.txtMidterm.value = "" thisform.txtEndTerm.value = "" thisform.TxtFinalGrade.Value = "" thisform.txtPrelim.SetFocus

Quit Button

thisform.Release

String Concatenation in Modern C++

 A simple string concatenation in modern C++ programming language that I wrote I hope you find my work useful. 

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.



Program Listing


#include <iostream>


int main()

{

std::string address = "Bacolod City";

    std::string complete = address + " Negros Occidental ";

    

    std::cout <<"\n";

    std::cout <<"\tString Concatenation in Modern C++\n";

    std::cout <<"\n";

    std::cout <<"\t" << complete;

    std::cout <<"\n";

}


Sunday, December 19, 2021

Largest Element in Diagonal Matrix in C++

Largest Element in Diagonal Matrix in C++

 Machine Problem in C++

// Write a program to find the largest element of the main diagonal 

// for an integer matrix: A(4.4) 

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Program Listing

// Write a program to find the largest element of the main diagonal // for an integer matrix: A(4.4) #include <iostream> using Matrix = int[4][4]; [[nodiscard]] int max_elem(const Matrix& m) { int max = m[0][0]; for (int row = 1, col = 1; row < 4 && col < 4; ++row, ++col) if (m[row][col] > max) max = m[row][col]; return max; } int main() { Matrix matrix = { { 1, 2, 3, 4 }, { 5, 6, 7, 8 }, { 9, 10, 11, 12 }, { 13, 14, 15, 16 } }; std::cout << "Max elem: " << max_elem(matrix) << "\n"; }

Saturday, December 18, 2021

Simple Do While Loop In PHP

Simple Do While Loop In PHP

 A simple program to show how to declare do while loop statement in PHP programming.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.




Program Listing


<?php

    $output = "";

    if(isset($_POST["number"])){

        $number = $_POST["number"];

        $x = 1;

        do {

            $output .= "$x ";

            $x++;

        } while ($x <= $number);

    }


    if ($output != "") {

        $output = '<p class="text-center mb-1">Your numbers are:</p><h3>'.$output.'</h3>';

    }

?>

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Simple Do While Loop In PHP</title>

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">

    <style>

        body {

            background-color: #fafafa;

            min-height: 100vh;

            padding: 50px 0;

        }

        form {

            width: 400px;

        }

    </style>

</head>

<body class="d-flex justify-content-center align-items-center text-center">

    <form action="" method="POST" class="card p-2">

        <div class="card-body">

            <h4>Simple Do While Loop In PHP</h4>

            <h5>Jake R. Pomperada, MAED-IT, MIT</h5>

            <hr>

            <div class="my-4">

                <label for="number" class="form-label">Enter a number:</label>

                <input type="number" class="form-control" name="number" id="number">

                <button type="submit" class="btn btn-primary btn-sm btn-block w-100 mt-2">OK</button>

            </div>

            <?php echo $output; ?>

        </div>

    </form>

</body>

</html>

Student Class Record in C++

Student Class Record in C++

* Machine Problem in C++

 *

 * Student Class Record

 * Start by asking the users for a list of students (three or more).

 * The user has 2 options after,view grades and input quiz scores.

 * On view grades, show the average grade of each

 * student (total score/total quiz).

 * On input quiz scores, first ask for the total quiz items.

 * Then ask for the score of each student (you initialized). Done.


I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Program Listing

/* * grades.cpp * Mr. Jake Rodriguez Pomperada, MAED-IT, MIT * www.jakerpomperada.com and www.jakerpomperada.blogspot.com * jakepomperada@gmail.com * Bacolod City, Negros Occidental Philippines * December 18, 2021 Saturday * * Machine Problem in C++ * * Student Class Record * Start by asking the users for a list of students (three or more). * The user has 2 options after,view grades and input quiz scores. * On view grades, show the average grade of each * student (total score/total quiz). * On input quiz scores, first ask for the total quiz items. * Then ask for the score of each student (you initialized). Done. */ #include <iostream> #include <vector> #include <numeric> class Student { public: void add_score(int score) { m_scores.push_back(score); } double get_avg_score() const noexcept { double sum = std::accumulate(m_scores.begin(), m_scores.end(), 0.0); return sum / m_scores.size(); } private: std::vector<int> m_scores; }; std::vector<Student> enter_scores(int num_students) { int num_scores = 0, temp = 0; std::cout << "How many scores per student: "; std::cin >> num_scores; std::vector<Student> students; for (int j = 0; j < num_students; ++j) { Student student; for (int i = 0; i < num_scores; ++i) { std::cout << "Score " << i + 1 << " for student " << j + 1 << ": "; std::cin >> temp; student.add_score(temp); } students.push_back(student); } return students; } void view_scores(const std::vector<Student>& students) { std::cout << "\n\n"; std::cout << "Students report\n"; std::cout << "===============\n\n"; int count = 1; if (students.empty()) { std::cout << "No students to report.\n"; return; } for (const auto& student : students) { std::cout << "Average score for student " << count++ << '\t' << student.get_avg_score() << "\n"; } } int main() { int num_students = 0, choice = 0; bool finished = false; std::vector<Student> students; std::cout << "\n"; std::cout << "\tStudent Class Record in C++\n"; std::cout << "\n"; std::cout << "Number of students(min 3): "; std::cin >> num_students; if (num_students < 3) { std::cout << "Invalid number of students.\n"; finished = true; } while (!finished) { std::cout << "1 - Enter scores\n2 - View scores\n3 - Exit\n"; std::cout << "Enter your choice: "; std::cin >> choice; if (choice == 1) students = enter_scores(num_students); else if (choice == 2) view_scores(students); else if (choice == 3) finished = true; } }

Thursday, December 16, 2021

Hypotenuse Value of Right Triangle in C++

 /* 3. Summative Assessment 2

Write a C++ program that calculate and displays the hypotenuse value

of right angle triangle. 

There are 2 right triangle base and height measurements:

The  first  triangle's  base  is  3  and  height  is  5 .

The  second  triangle's  base  is  4  and  height  of  8.


Find out the area of each triangle. Use a structure for this program.

The area of a triangle is computed as:


Area  =  0. 5  *  base  *  height

The output should be:


The  first  triangle  hypotenuse  is  5.83095

The  area  of  the  first  triangle  is  7 . 5

The  second  triangle  hypotenuse  is  8.94427

The  area  of  the  first  triangle  is  16

*/


I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Program Listing

/* 3. Summative Assessment 2 Write a C++ program that calculate and displays the hypotenuse value of right angle triangle. There are 2 right triangle base and height measurements: The first triangle's base is 3 and height is 5 . The second triangle's base is 4 and height of 8. Find out the area of each triangle. Use a structure for this program. The area of a triangle is computed as: Area = 0. 5 * base * height The output should be: The first triangle hypotenuse is 5.83095 The area of the first triangle is 7 . 5 The second triangle hypotenuse is 8.94427 The area of the first triangle is 16 */ #include <iostream> #include <string> #include <cmath> using namespace std; struct triangle { float a, b, c; }; int main() { triangle t1 = { 3, 5 }, t2 = { 4, 8 }; auto hypo1 = sqrt(t1.a * t1.a + t1.b * t1.b); cout << "The first triangle hypotenuse is " << hypo1 << "\n"; auto area1 = 0.5f * t1.a * t1.b; cout << "The area of the first triangle is " << area1 << "\n"; auto hypo2 = sqrt(t2.a * t2.a + t2.b * t2.b); cout << "The second triangle hypotenuse is " << hypo2 << "\n"; auto area2 = 0.5f * t2.a * t2.b; cout << "The area of the second triangle is " << area2 << "\n"; return 0; }

Simple For Loop In PHP

Simple For Loop In PHP

 A simple for loop statement program that I wrote using PHP programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Program Listing

<?php $output = ""; if(isset($_POST["number"])){ $number = $_POST["number"]; for ($i=1; $i <= $number; $i++) { $output .= "$i "; } } if ($output != "") { $output = '<p class="text-center mb-1">Your numbers are:</p><h3>'.$output.'</h3>'; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Simple For Loop In PHP</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"> <style> body { background-color: #fafafa; min-height: 100vh; padding: 50px 0; } form { width: 400px; } </style> </head> <body class="d-flex justify-content-center align-items-center text-center"> <form action="" method="POST" class="card p-2"> <div class="card-body"> <h4>Simple For Loop In PHP</h4> <h5>Jake R. Pomperada, MAED-IT, MIT</h5> <hr> <div class="my-4"> <label for="number" class="form-label">Enter a number:</label> <input type="number" class="form-control" name="number" id="number"> <button type="submit" class="btn btn-primary btn-sm btn-block w-100 mt-2">OK</button> </div> <?php echo $output; ?> </div> </form> </body> </html>

Wednesday, December 15, 2021

Addition of Two Numbers Using Two Dimensional Array in C++

Addition of Two Numbers Using Two Dimensional Array in C++

 A simple program to ask the user to ask two numbers and then the program will solve the sum of two given numbers using two dimensional arrays using C++ programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Program Listing

// Addition of two numbers using two dimensional array // November 1, 2018 Thursday // Author: Mr. Jake R. Pomperada,MAED-IT // www.jakerpomperada.com // jakerpomperada@gmail.com // jakerpomperada@jakerpomperada.com // Product of Bacolod City, Negros Occidental Philippines #include <iostream> using namespace std; int main() { int a[1][1]; char reply; int sum=0; do { cout <<"\n\n"; cout << "Addition of Two Numbers Using Two Dimensional Array in C++"; cout <<"\n\n"; cout << "Enter first number : "; cin >> a[0][0]; cout <<"Enter second number : "; cin >> a[0][1]; sum = (a[0][0]) + (a[0][1]); cout <<"\n\n"; cout << "The total sum is " << sum <<"."; cout <<"\n\n"; cout <<"Do you want to continue? Y/N : "; cin >> reply; } while(toupper(reply)=='Y'); cout <<"\n\n"; cout <<"\tEnd of Program"; cout <<"\n\n"; }

Break Statement in C Programming Language

Break Statement in C

 A simple program to demonstrate how to declare and use the break statement using C programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Program Listing

/*break.c Author : Mr. Jake R. Pomperada,BSCS,MAED-IT Date : November 23, 2018 Tuesday 11:48 AM Location : Bacolod City, Negros Occidental Website : http://www.jakerpomperada.com Emails : jakerpomperada@jakerpomperada.com jakerpomperada@gmail.com jakerpomperada@yahoo.com jakerpomperada@aol.com */ #include <stdio.h> int main() { int a=0; printf("\n\n"); printf("\tBreak Statement in C"); printf("\n\n"); for (a=1; a<=10; a++) { if (a==6) { break; } printf("\t%4d",a); } printf("\n\n"); printf("\tThank you for Using This Software."); printf("\n\n"); printf("\tEnd of Program"); printf("\n\n"); }

Tuesday, December 14, 2021

Average of Three Numbers in Python

Average of Three Numbers in Python

 

Machine Problem in Python

Write a program that will ask the user to give three numbers and then the program will compute the average of the three numbers using Python
programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Program Listing

# Jake R. Pomperada, MAED-IT, MIT
# www.jakerpomperada.com and www.jakerpomperada.blogspot.com
# jakerpomperada@gmail.com
# Bacolod City, Negros Occidental Philippines

# Machine Problem in Python
#
# Write a program that will ask the user to give three numbers and then
# the program will compute the average of the three numbers using Python
# programming language.

print()
print("\tAverage of Three Numbers in Python")
print()
a = int (input("Enter the First Number: "))
b = int (input("Enter the Second number: "))
c = int (input("Enter the Third number: "))

average=(a+b+c)/3

print()
print("The average of three numbers is ", average)
print("\n\tEnd of Program")

Monday, December 13, 2021

Simple Multiplication Table Using Arrays in C++

Simple Multiplication Table Using Arrays in C++

 A simple multiplication table using arrays in C++ programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.





Program Listing

#include <cstdlib> #include <iostream> #include <iomanip> using namespace std; int main(int argc, char *argv[]) { int values[10] = {1,2,3,4,5,6,7,8,9,10}; int values2[10] = {10,9,8,7,6,5,4,3,2,1}; cout << "\n\n"; cout << " ===== SIMPLE MULTIPLICATION TABLE USING ARRAYS IN C++ ====="; cout << "\n\n Created By: Mr. Jake R.Pomperada,MAED-IT"; cout << "\n\n"; for (int list=0; list <10 ; list++) { cout << "\n"; cout<< setw(2) << list[values] << " x " << setw(2) << list[values] << " = " << setw(2) << list[values] * list[values]; cout<< setw(10) << list[values] << " + " << setw(2) << list[values2] << " = " << setw(1) << (list[values] + list[values2]); } cout << "\n\n"; system("PAUSE"); return EXIT_SUCCESS; }

Sunday, December 12, 2021

Sum and Average of Two Numbers in C++

Sum and Average of Two Numbers in C++

 A simple program to ask the user to give two numbers and then the program will solve the sum and average of the two given numbers using C++ programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.






Program Listing

#include <iostream> // sum_average.cpp // Written By: Mr. Jake Rodriguez Pomperada, MAED-IT, MIT // www.jakerpomperada.com and www.jakerpomperada.blogspot.com // jakerpomperada@gmail.com // Bacolod City, Negros Occidental Philippines int main() { float val_one, val_two; float sum, average; std::cout <<"\n"; std::cout << "\tSum and Average of Two Numbers in C++\n\n"; std::cout << "\tEnter First Value : "; std::cin >> val_one; std::cout << "\tEnter Second Value : "; std::cin >> val_two; sum = (val_one + val_two); average = (sum/2); std::cout <<"\n"; std::cout << "\tThe sum is " << sum << ".\n"; std::cout << "\tThe average is " << average << ".\n"; std::cout <<"\n"; }

User Defined Function in C++