journal 2.docx - Lab#02 Visual Programming Date Objective To become familiar with C syntax with respect to console and form application Tools used C

# journal 2.docx - Lab#02 Visual Programming Date Objective...

This preview shows page 1 - 3 out of 6 pages.

Lab#02 Visual Programming Date:18-09-19 Objective: To become familiar with C# syntax with respect to console and form application. Tools used: C# Visual studio Task 1: Calculate Tax of given money according to given rules. Code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication2 { class Program { static void Main( string [] args) { Console .WriteLine( "***************** Zeeshan Ali Ch ***************" ); Console .WriteLine( "***************** 01-131172-041 ***************" ); string ch; do { int ab; double result=0; Console .Write( "Enter the amount:" ); ab = Convert .ToInt32( Console .ReadLine()); if (ab > 0 && ab <= 10000) { result = (5 * ab) / 100; Console .WriteLine( "The tax on this amount is:{0}" , result); } else if (ab > 10000 && ab <= 100000) { result = (8 * ab) / 100; Console .WriteLine( "The tax on this amount is:{0}" , result); } else if (ab > 100000) { result = (8.5 * ab) / 100; Console .WriteLine( "The tax on this amount is:{0}" , result); } else { Console .WriteLine( "Invalid input" ); } Console .Write( "Press y to run again: " );
Lab#02 Visual Programming Date:18-09-19 ch = Console .ReadLine(); } while (ch == "y" || ch == "Y" ); } } } Output: Task 2: Implement basic functionality of calculator.

#### You've reached the end of your free preview.

Want to read all 6 pages?

• Spring '17
• Computer program, Ali Ch

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern