0% found this document useful (0 votes)
31 views3 pages

Visual Programming Mid Assignment For SE-M-E 31-5-22

The document contains 12 questions for a mid-assignment on visual programming. The questions cover topics like calculating distance and converting temperatures between units, calculating electricity bills and employee salaries, and programs that output different messages or images based on user input values.

Uploaded by

Umran Jabbar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views3 pages

Visual Programming Mid Assignment For SE-M-E 31-5-22

The document contains 12 questions for a mid-assignment on visual programming. The questions cover topics like calculating distance and converting temperatures between units, calculating electricity bills and employee salaries, and programs that output different messages or images based on user input values.

Uploaded by

Umran Jabbar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Department of Information Technology, Division of Physical Sciences

GC University, Faisalabad.
Mid Assignment
Class: BS (SE) (Morning & Evening) Semester: 6th
Subject: Visual programming 3(3-1) Submitted Date: 31-05-2022
Note: Solved the following questions on computer as well as paper

Q # 1 Write a program to calculate distance between two cities in (meters, foots and inches) and
also print them. Input the distance value (in kilometers) within the program. Set the
appropriate picture. For validating Text Box use setError method for show error and for
checking empty or null. Show the answer in text view as blow:

Q # 2 Write a program to convert temperature (Celsius to Fahrenheit and Kelvin, Fahrenheit to


Celsius and Kalvin, Kalvin to Fahrenheit and Celsius) and print them on screen. Input the
values within the program. For validating Text Box use setError method for show error
and for checking empty or null. Check also user must select any one option. Show the
answer in toast:

Q # 3Write a program that inputs units consumed of electricity at home and calculate electricity
bill according to given residential tariff. For validating Text Box to checking empty or null
then button will also disable. Show the answer in toast if sample data is 250 then display
message is:
Total units consumed are 250 @ Rs.5 per unit and total bill is: 1250
a) If units consumed are <=200 then the cost Rs.3 per unit.
b) If units consumed are >200 then the cost Rs.5 per unit.

Q #4 Write a program that inputs the basic salary of an employee and find his Net salary. In a
company an employee is paid as under:
a) If basic salary is less than Rs.15000, then HRA = 10% of basic salary and DA =1000/-
b) If salary is equal or above Rs.15000, then HRA = 20% of basic salary and DA = 2000/-
For validating Text Box to checking empty or null then button will also disable. Show the
answer in text view as blow:

Q#5 Write a program that will calculate and print the total salary of daily wage employee as
per following wages structure:

Set the appropriate picture. For validating Text Box use setError method for show error
and for checking empty or null. Show the answer in text view as blow:
Note:18 hours – 8 hours then extra 10 hours
Q#6 Write a program that input time from the user and follow the instructions below;

 If time less than 10 clock, then display message” Good morning.”


 If time less than 13 clock, then display message” Good day.”.
 If time less than 16 clock, then display message” Good after noon.”.
 If time less than 20 clock, then display message” Good evening.”.
 If time less or equal 24 clock, then display message” Good night.” Otherwise “Invalid time
… Try again!”.
For validating Text Box use setError method for show error and for checking empty or
null. If user type above 24 hours, then button will also disable.

Q#7 Write a program that input the GPA from user for the university admission and follow the
below instructions;
 The admission criteria in the university is 3.5 GPA, when user input value equal to 3.5 GPA the
program will display a message as picture “Admission granted due to equal GPA”.
 If input value greater then 3.5, the message should display as picture “Well done! You are
qualified for scholarship as per university rules” otherwise display message “Sorry No
Admission grated due to low GPA”.
Note: There three images show as per above criteria

Image # 1 Image # 2 Image # 3

Q#8 Write a program that inputs user name and user password from the user and check user
name and password by following instruction:
 If user name & password correct then display message “Login successful”.
 If username correct but password wrong than display message “Incorrect
PASSWORD, Try again.”,
 If username is wrong then display message is” Incorrect Login Details, Try
again”;
 If three-time wrong user name or password the application automatically closed.

Q#9 Write a program that inputs the height of a person in centimeter and categorize the person
according to their height. For validating Text Box to checking empty or null then button
will also disable. Show the answer in Alert Dialog Box with OK Button.
 If height <155 then display message “The person is Dwarf.”
 If height >=155 and <=170 then display message “The person is average
heighted.”
 If height >=171 and <=200 then display message “The person is taller.” Otherwise
display message Abnormal height.

Q#10 Write a program to inputs name and quantity of any fruit item and calculate the total bill
according to given instructions: For validating Text Box (Fruit and its quantity) to
checking empty or null then button will also disable. Show the answer in text view as
blow:
 Press [S] to buy sweet Lemon @ Rs.120 per dozen & Rs. 100 if you buy more than a
dozen.
 Press [B] to buy Banana @ Rs.100 per dozen & Rs. 80 if you buy more than a dozen.
 Press [O] to buy Orange @ Rs.200 per dozen & Rs. 150 if you buy more than a dozen.

Q# 11 Write a program that input age from the user and calculate the following:
 If user age is greater than 60 years, the program will display message “You are really
old”.
 If user age greater than 35 years, the message should appear that “You are young”.
 If user age 18 years then display message is “You are pretty young!” otherwise the
message should be” Grow up my dear”.

For validating Text Box to checking empty or null then button will also disable.
Show the answer in text view as blow:

Q# 12 Write a program that show the timer in box and control the vehicle. First Stopped Vehicle
of red light and then timer will start and display images according to given criteria as
below time;
 If time 35 seconds, the signal is orange and vehicle is ready to drive
 If time 45 second, the signal is green and vehicle drive smoothly.
 If time 60 seconds, the signal is red and vehicle stopped

Image # 1 Image # 2 Image # 3

You might also like