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

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

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