CN4001 Applied ICT Principles Assignment Problem

Assignment Help Python Programming
Reference no: EM132386532

CN4001 Applied ICT Principles Assignment - Practical Exercises Topic: Making Choices, Staffordshire University, UK

Task 1 - For this task we will attempt to write a program that asks the user to enter two numbers and then compares these two numbers.

a) Create a NEW PROJECT (New > New Project) - call it Lab3a (make sure Create Main Class is unticked)

b) Add a new MAIN CLASS to your project (New > File> Java Main Class) - call it CompareApp.

c) Write the code to declare two variables, 'num1' and 'num2' say. These variables should be able to hold whole numbers only. Then write additional code to allow the user to enter values into these two variables.

d) Use in if statement so that the message "Numbers ARE equal" is displayed if the two numbers are equal. Then display an "END OF PROGRAM" message at the end of the program.

e) Add an else branch to the above if statement so that the message "Numbers ARE NOT equal", is displayed if the two numbers are not equal. The "END OF PROGRAM" message should still be displayed at the end of the program.

f) Modify the program further so if the two numbers are not equal, as well as displaying the message "Numbers ARE NOT equal", the program then displays "FIRST number BIGGER" if the first number is bigger than the second or displays "SECOND number BIGGER" if the second number is bigger than the first. The "END OF PROGRAM" message should still be displayed at the end of the program.

g) Add some Javadoc comments into this program.

h) Show your work to your tutor and then upload the CompareApp.java file to Moodle via your group's submission link.

Task 2 - For this task we will attempt to write a program that reveals secrets to spies depending upon their security level (1-3).

a) Create a NEW PROJECT (New > New Project) - call it Lab3b (make sure Create Main Class is unticked)

b) ADD A NEW MAIN CLASS to your project (New > File> Java Main Class) - call it SecretsApp.

c) This program will allow spies to enter their security level. Declare the appropriate variable and a Scanner object.

d) Write the code that asks the user to enter their security level and store this level in the appropriate variable.

e) The following secrets can be revealed to the spies depending upon their security level:

LEVEL 3: "The cook is an alien"

LEVEL 2: "There is a secret room in the basement"

LEVEL 1: "The security guard is a robot"

Use a switch statement to reveal the correct secret to the spy (note, only 1 secret should be revealed to each spy). Then display an "END OF PROGRAM" message at the end of the program.

f) Finally, adapt the program so that an error message "NO SUCH LEVEL" is displayed when an incorrect security level is entered.

g) Add some Javadoc comments into this program.

h) Show your work to your tutor and then upload the SecretsApp.java file to Moodle via your group's submission link.

Extra Challenges -

1. Modify the CompareApp program further so if the two numbers are not equal, as well as displaying the message "Numbers ARE NOT equal", the program also displays "FIRST number BIGGER" if the first number is bigger than the second and displays "SECOND number BIGGER" if the second number is bigger than the first.

2. Modify the switch statement from the SecretsApp program so that a spy with level 3 clearance can get to see all 3 secrets, the spy with level 2 can see both level 2 and level 1 secrets, but a spy with level 1 clearance can only see the level 1 secret.

3. Create a suitable project and Class in NetBeans to solve the following task:

Implement a program that asks the user to enter two numbers and then guess at the sum of those two numbers. If the user guesses correctly a congratulatory message is displayed, otherwise a commiseration message is displayed along with the correct answer.

Note - Just make programming.

Reference no: EM132386532

Questions Cloud

Incorporators of caprock investments : The incorporators of Caprock Investments, Inc., want their new corporation to have the authority to transact nearly any conceivable type of business.
Socratic view of morality summarized by frankena : Socratic view of morality summarized by Frankena, is a person brought up by immoral parents in a corrupt society capable of making correct moral judgments?
What is theory propose your own definition : "What is Theory" propose your OWN definition of what theory is and why it is important. how those issues intersect with issues such as race, class, etc.
Develop a marketing plan for home health company : You currently work as a coordinator for New City Home Care, a private home health company, task is developing a marketing plan
CN4001 Applied ICT Principles Assignment Problem : CN4001 Applied ICT Principles Assignment - Topic: Making Choices, Assessment Help - Staffordshire University, UK - Write code to declare two variables
Are you doing the right things or are you just doing stuff : Priority Management: Are You Doing the Right Things or Are You Just Doing Stuff? What are your Sugar Babies (things you have to get done) What are your Red Hots
Choose one campus at chattahoochee technical college : Choose one campus at Chattahoochee Technical College (either Appalachian, Austell, Canton, Marietta, Mountain View, North Metro, Paulding or Woodstock),
Immigration issue in united states : Immigration in the United States is legal and illegal and is highly associated with low skilled workers who are employed at low costs.
Ceeating a strategy for deploying a new reward system : For the Module 5 milestone, create a strategy for deploying a new reward system that is linked to product innovation and product launches.

Reviews

Write a Review

Python Programming Questions & Answers

  What is the best tool program to formulate a flow chart

What is the best tool, program to formulate a flow chart for programming? It seems time consuming to do on powerpoint but it looks better to me on powerpoint.

  Conduct research on the fibonacci sequence

Conduct research on the Fibonacci sequence. Write a 150 word summary of the information. Include examples and real world application for it.

  Implement key exchange using the diffie-hellman algorithm

Implement key exchange using the Diffie-Hellman algorithm, when peer- to-peer connections are made between bots and achieve confidentiality through encryption of the client-server commu- nications with an appropriate block or stream cipher.

  How do you connect the sakila database and add a record

In python, how do you connect the sakila database and add a record to the database? The response paper should be in APA format.

  Create two instance variables to store the speed

Create two instance variables to store the speed and the height of the drone. Initialize them to 0.0. This method has no parameters other than self.

  Create a python script that takes two parameters

Create a Python script that takes two parameters. List all files names, size, date created in the given folder. Use catch-exception block.

  Write a modularized program that will utilize a main menu

Write a modularized program that will utilize a main menu to control the program's functions and a list to store the members of your team.

  Accept a temperature in fahrenheit and convert it to celsius

How to write a module named temperatureConverter.py with the following functions, and use these in your own program, mymain.py.

  Design an application in python

Design an application in Python- The application would generate a set of 100 integers in a random manner in the range of 50 to 150 including both the numbers in the range

  Write pseudocode that prompts you to enter customer name

Your pseudocode can be submitted by pasting it into the Submission screen or attaching it as a text file or Word document.

  What are files and what are the benefits of using files

Write a Python program that reads a text file 'sentence.txt' containing four lines of text and prints those lines.

  Write a program that prompts for the day and month of user

CPSC 1301L COMPUTER SCIENCE-Write a program that prompts for the day and month of the user's birthday and then prints a horoscope. Make up technology.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd