Download as pdf
Download as pdf
You are on page 1of 11
UNIVERSITY OF EDUCATION LAHORE (FAISALAB. Submitted to: DR. Muhammad Anwar Submitted by: M Shahzaib Roll No.: bsf23005088 Department: BS Computer Science Subject: Programming Fundamentals Semester: 1 Morning Session: 2023-27 AD CAMPUS) ASSIGNMENT PROGR 4; int main() { cout << "ph int num; cout << "Ente; cin >> nur int factorial = 4 if (num <0) { cout << "Factorial cannot be calculated for negative numbers."< using namespace std; int main () { cout << "M Shahzaib "<>numt; cout<<"ENTER SECOND NUMBER:"<>num2; cout<<"ENTER THIRD NUMBER:"<>num3; if(num2>num1 &&num2>num3) cout<<"MAXIMUM NUMBER IS:"<num1&&num3>num2) cout<<"MAXIMUM NUMBER IS:"< using namespace std; int main () cout << "M Shahzaib "<>numb; if(aumb>=10) cout<<"Number of : "<éx1<<" Note "< using namespace std int main) { cout << "M Shahzaib "<> choice; if (choice == ‘B' || choice == dt cout << "Your current balance is: $" << balance << endl} UNIVERSITY OF EDUCATION LAHORE (FAISALABAD cal alse if (choice prjchoice - ont jouble amount; xt << "Enter the amount to deposit: $"; » sn >> amount; (amount < 0) { cout << “Invalid. amount. Deposit amount must be Positive.” " << endl; aise ( sdlance + amount; saut << "Deposit of $" << amount <<" successful." << endl; ‘ut << "Your new balance is: $" << balance << endl; ‘Seif (choice == 'W || choic: Ww) ‘ouble amount; . ‘ut << “Enter the amount to withdraw: $": on>> amount; amount < 0) { S4 balance) { “'S<"Insufficient funds, Your current balance is: $" << balance << endl; ) ey SWERSiTy OF EDUCATION LAHORE (FAISALABAD CAMPUS) noe -= amount jendrawal of $ << amount palance is: $° << balanc t <<" successful.” << endl. cote W cout << "Yournew e << end! } eset cout << invalid encice. Please 1 again.” << end: } cout << "Do you want to perform another transaction? (y/n): ". cin >> choice: cout << endl; } while (choiee == "|| choice ‘cout <« "Thank you for using our ATM cout << "M Shahzaib "< using namespace std; int main() { — cout'<< "M Shahzaib "<> units; (units <= 100) ¢ fate = 5.0; else if (units <= 200) { D CAMPUS) WERStry OF EDUCATION LAHORE (FAISALABA\ UNIV! rate = 10.0; yelse { Tate = 20.0; } bill = units * rate; cout << "Total electricity bill Rs. "<< bill <

You might also like