0% found this document useful (0 votes)
12 views

Module 5 A1

The document contains 4 C++ programs that take user input and perform conditional checks. Program 1 checks if a user is eligible to vote based on their age. Program 2 checks if a user's input number is positive or negative. Program 3 checks if a user's input number is even or odd. Program 4 calculates an employee's monthly income based on their sales amount and different income brackets. Each program outputs the result and includes the author's name and date as a signature.

Uploaded by

dagimeylakownt
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Module 5 A1

The document contains 4 C++ programs that take user input and perform conditional checks. Program 1 checks if a user is eligible to vote based on their age. Program 2 checks if a user's input number is positive or negative. Program 3 checks if a user's input number is even or odd. Program 4 calculates an employee's monthly income based on their sales amount and different income brackets. Each program outputs the result and includes the author's name and date as a signature.

Uploaded by

dagimeylakownt
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Name: San Pablo, Gericho James M.

Subject: CPE0003L
Sec on: TE21 Date: October 19, 2023

Source Code Output


Case 1: Case1:

#include <iostream>
using namespace std;

int main(){

int Age;

cout<<"Hello! Input your age here: ";


cin >> Age;

if (Age > 18){


cout<<"You are a valid voter!" <<endl;
}
else {
cout<<"You are not yet a valid voter!"
<<endl;
}

// Program Signature
cout<<"\n Name: San Pablo, Gericho James M.";
cout<<"\n Ac vity: Module 5 Ac vity 1 Case 1";
cout<<"\n Date: October 19, 2023";

return 0;
}
Case 2:
#include <iostream>
using namespace std;

int main(){

int Number;

cout<<"Hello! Input a number: ";


cin >> Number;

if (Number>0){
cout<<"The number you inpu ed is
posi ve! " <<endl;
}
else {
cout<<"The number you inpu ed is
nega ve!" <<endl;
}

// Program Signature
cout<<"\n Name: San Pablo, Gericho James M.";
cout<<"\n Ac vity: Module 5 Ac vity 1 Case 1";
cout<<"\n Date: October 19, 2023";

return 0;
}
Case 3:
#include <iostream>
using namespace std;

int main(){

int number;

cout<<"Hello! Please input a number: ";


cin >> number;

if (number%2 == 0){
cout<<"The number inpu ed is even!"
<<endl;
}
else {
cout<<"The number inpu ed is odd!"
<<endl;
}

// Program Signature
cout<<"\n Name: San Pablo, Gericho James M.";
cout<<"\n Ac vity: Module 5 Ac vity 1 Case 1";
cout<<"\n Date: October 19, 2023";

return 0;
}
Case 4:
#include <iostream>
using namespace std;

int main(){

int Sales, Income;

cout<<"Hello! Enter your Monthly Sales: $";


cin >> Sales;

if (Sales >= 50000){


Income=(575 + (0.16*Sales)) ;
cout<<"Your Income is :$" <<Income ;
}
else if (Sales >= 40000){
Income=(550 + (0.14*Sales)) ;
cout<<"Your Income is :$" <<Income ;
}
else if (Sales >= 30000){
Income=(525 + (0.12*Sales)) ;
cout<<"Your Income is :$" <<Income ;
}
else if (Sales >= 20000){
Income=(500 + (0.09*Sales)) ;
cout<<"Your Income is :$" <<Income ;
}
else if (Sales >= 10000){
Income=(450 + (0.05*Sales)) ;
cout<<"Your Income is :$" <<Income ;
}
else {
Income=(400 + (0.03*Sales)) ;
cout<<"Your Income is :$" <<Income ;
}

// Program Signature
cout<<"\n\n Name: San Pablo, Gericho James
M.";
cout<<"\n Ac vy: Module 5 Ac vity 1 Case 4";
cout<<"\n Date: October 19, 2023\n";
system ("pause");
return 0;
}

You might also like