COS10009 Lab 2.pdf - Swinburne University of Technology Sarawak COS10009 Introduction to Programming \u2013 Semester 2 2020 Lab 2 Pass Tasks Submission

COS10009 Lab 2.pdf - Swinburne University of Technology...

This preview shows page 1 - 2 out of 4 pages.

Swinburne University of Technology Sarawak COS10009 Introduction to Programming Semester 2 / 2020 Lab 2 Pass Tasks Submission Date : 25 th September 2020 (Friday) Control Flow, Arithmetic Expression & Operators (Lab 02) Pass Task 2.1 Name Tester Task: Create a program that tests a user's name and echoes a custom message. Control flow enables you to easily add conditions and loops to your programs. In this task you will create a small program that uses conditions and loops to output custom messages to users. To Do: Create a small program that will check the user’s n ame and respond with different messages for different people. Implement a main procedure with the following logic: ■ It reads a name from the user, and displays back a message. ■ Check if the name entered is your name. ■ If the name is your name, output th e message 'Awesome name!' ■ Otherwise output the silly name message: Steps: 1: Prompt 'Please enter your name: ', and assign the input to a variable 2: if name is equal to your name or your tutor’s name then output ‘ is an awesome name’ otherwise: 3. Prin t ‘– the name entered is a silly name!’.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture