Skip to main content

Posts

Showing posts from May, 2018

Intro Java Lab 2

Question 1 - Simple Conditions  Create a console application that accepts two integer from the user and then displays if the values are equal or not equal. Question 2 - Equality and relational operators  Modify the above application so that application uses the following condition to display the outputs If the first value is equal to second value then the system displays "First value is equal to second value" If the first value is not equal to second value then the system displays "First value is not equal to second value" If the first value is greater than second value then the system displays "First value is greater than second value" If the first value is less than second value then the system displays "First value is less than second value" If the first value is greater or equal second value then the system displays "First value is greater than or equal to second value" If the first value is less than or equal to secon...

Intro Perl Lab 3

1. Create a perl program. Use a hash to store all Province Code and Province Name of Canada. Then print them.  Output should be as shown below:  PE-Prince Edward Island BC-British Columbia NB-New Brunswick ON-Ontario QC-Quebec MB-Manitoba NS-Nova Scotia 2.   Create a perl program that use a hash to store all Week day code and Week day. Then print them.  Output should be as shown below:  M - Monday  T - Tuesday W - Wednesday H - Thursday F - Friday S - Saturday U - Sunday 3.  Write a program that simulates rolling five dice. Assign values between 1 and 6 to five different variables and display all five on the screen as well as the sum of the five numbers.  Output should be as shown below.  Die 1 -- 5 Die 2 -- 3 Die 3 -- 1 Die 4 -- 1 Die 5 -- 6 Sum is 16.

Intro Perl Lab 2

Perl Lab 2 a) Write a perl program to create an array of 10 student name. b) Modify the program to create a second array to hold the marks of the 10 students in the above array. c) List student name and student marks as shown below:  Student Name       Student Marks Arshdeep                    80 Sukhdeep                   90 Prabdeep                    76 Sandeep                     56 Mandeep                     46 d) Modify the above program to add pass or fail as shown below: Student Name       Student Marks          Pass/Fail Arshdeep                    80     ...

Intro Perl Lab 1

Exercise 1 Create a perl program that stores your StudentID, First Name, Last Name, program Name, Course ID and CourseName in 6 variables and then creates the following output: Student ID: 99999999 Name: First_name Last_Name Program: Program Name course ID: Course ID Course Name: Course Name Exercise 2 Create an array that stores the days of the week and then print the days of the week to the console screen. Output should be as shown below Mon Tue Wed Thu Fri Sat Sun