Write piece of code using only one switch

Assignment Help Basic Computer Science
Reference no: EM132254045

1) Write piece of code using only one switch and no other control structure to read one character and do the following:

If a 1 print "Got a ONE"

If a 3 print "Got a THREE"

If a 5 print "got a FIVE"

If a 7 print "Got a SEVEN"

If a 9 print "Got a NINE"

If an even number print "Got an even number"

If a non-digit print "got a non-digit"

2) Write section of code that will take an integer variable Y and if Y negative, will set it to zero. If Y  is greater than zero, the code will add one to Y if and only if Y is an also an even number. 

Reference no: EM132254045

Questions Cloud

Create a presentation that will review all the changes : Create a presentation that will review all the changes that you have implemented to improve access control security.
Discuss what details can be included in a project scope : Discuss what details can be included in a project scope, and what items should not be included.
Describe how 16 sub-keys are generated : Describe how 16 sub-keys are generated from one key supplied to the DES operation
The law may be used to strengthen patient voice : Identify and explain 5 ways that the law may be used to strengthen patient voice.
Write piece of code using only one switch : 1) Write piece of code using only one switch and no other control structure to read one character and do the following:
Summarize the issues that face ride share companies : What types of policies are needed? What core principles apply here? What would be the best framework to use for a bank?
Analyze the sociological theories presented in unit : Analyze the sociological theories presented in this unit. Select five theories that you feel would benefit your community. Rank them in order of most effective.
Knowledge management system : What factors do you need to consider before adding data into a knowledge management system?
Processor of carrots cuts the green top off each carrot : A processor of carrots cuts the green top off each carrot, washes the carrots, and inserts six to a package.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Equilibrium gdp and aggregate price level

How would an increase in consumption spending affect an economy's equilibrium GDP and aggregate price level?

  Bottom of checks and deposit slips

This reading device is readily used in banks to read the numbers on the bottom of checks and deposit slips?

  Service model and deployment model in cloud computing

Distinguish (with 3 examples each) between service model and deployment model in cloud computing

  Why is the tension between centralization

Why is the tension between centralization and decentralization of R&D activities likely to be even greater for multinational firms than firms that compete

  Write the function linecount that reads text files

Write the function linecount that reads text files

  Explain file containing sporting goods which are sold online

You have file containing sporting goods which are sold online. Each item record contains item id, item name, item description, item category, item price, and units in stock.

  Trade and infrastructural development of the netherlands

Trade and infrastructural development of the Netherlands? Trade and technological progress of the Netherlands?

  Find the sum of the elements of an array called list1

Write a program to find the sum of the elements of an array called list1. The size of list1 is four bytes. The values of list1 are $FF, $1, $FE, and $02. To check your work, the sum should become $0200.

  Pricing structure for the products you are selling

How would you research and decide upon your pricing structure for the products you are selling?

  Find probability that the mean of the sample

Find probability that the mean of the sample is less than $445. Place your answer, rounded to 4 decimal places.

  Determining the troubleshooting basics

The desktop administration at a remote satellite office called you to let you know that after the installation of Windows, he noticed that the FLIP 3D is not working. Of course you prepare a list of questions to ask and have possible recommendatio..

  Matlab built-in vector operations

Write a function natlogApprox that takes scalar input arguments x and n, and returns the approximate value of ln(1+x). Note that your code should use MATLAB's built-in vector operations to solve this problem. Do not use for and while loops.

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