Write a program that inputs an integer in the range

Assignment Help Programming Languages
Reference no: EM13772252

Problem 1: Write a program that inputs an integer in the range [-32767, 32767] from the Serial Monitor and checks to see if that number is a prime number. If the number is a prime number, have the LED on pin 13 turn on. If not, then turn the LED off.

--Do the actual prime number checking in a function.
--You may display the result of the check on the Serial Monitor.
--Carefully comment your code.
--Suggest ways to make the code more ecient.

HINT: You may wish to consult a resource to eciently test for a number being prime.

Reference no: EM13772252

Questions Cloud

Create a balanced chemical equation : Create a balanced chemical equation showing a monoprotic acid and a diprotic acid with sodium hydroxide, NaOH.
What are the constraints on sunsweet growerss supply chain : What are the constraints on Sunsweet Growers's supply chain? What problems did Sunsweet Growers encounter as a result of these constraints? What was their business impact?
Importance of theory application and self-efficacy : How effective would your program be if it wasn't guided by a theoretical foundation?
Conventional level of personal moral development : Which of the following leadership mindset emphasizes tight top-down control, employee standardization and specialization, and management by impersonal measurement and analysis?
Write a program that inputs an integer in the range : Write a program that inputs an integer in the range [-32767, 32767] from the Serial Monitor and checks to see if that number is a prime number. If the number is a prime number, have the LED on pin 13 turn on. If not, then turn the LED off.
Electrons to silver in a redox reaction : Of the metals Au, Fe, Na, and Cd, which will not give up its electrons to silver in a redox reaction
Calculate the molar absorptivity at each wavelength : Calculate the absorbance A at each wavelength, calculate the molar absorptivity at each wavelength and what would T be if the cell length were in each case 2.00 cm - What were the concentrations of MEK in the solutions A-D?
What was your favorite assigned reading and discussion : What was your favorite assigned reading and/or discussion, and why? Do you feel that you have become a better reader and writer through this course? If so, in what ways? If not, why?
The advantages and disadvantages of social networking : Analyze how the university might integrate at least two social media and networking technologies to accomplish their goals. Your analysis must cover the advantages and disadvantages of social networking. The president of the university also needs ..

Reviews

Write a Review

Programming Languages Questions & Answers

  Write program to find whether number is divisible by eleven

Write down the program which prompts user to enter positive integar and then uses criterion to find out whether number is divisible by 11.

  Program which accepts candy name-price per pound

A program which accepts the candy name (for example, "chocolate-covered cherries"), price per pound, and number of pounds sol in average month, and displays item's data only if it is best-selling item.

  Write pseudocode to show positive and negative numbers

Write down pseudocode which will accept 25 integers and show the number of positive and negative numbers. Mention whether pseudocode utilizes a finite or indefinite loop.

  Write a program which manipulates fractions

Write a program which manipulates fractions. It should get two fractions from the user by inputing two numerators and two denumerators (integers) from 0 to 999 and then have the user select an operation from addition, subtraction, multiplication, ..

  Program to calculate overtime pay for salary based employee

To calculate overtime pay for a salary based employee, first find hourly rate by dividing gross pay by 40, and then calculate overtime pay.

  Create script which checks day of the week

Create a script which checks day of the week, and takes one of two actions (step 2 or 3) depending on the day. If day is Monday through Friday, print (send to stdout) name of the day.

  Design program to accepts account number

Design a program that accepts an account number, the account owner's first and last names, and a balance. Print the projected running total balance for each year for the next 20 years.

  Evaluate the arithmetic expressions

Prepare a Lisp program to evaluate the arithmetic expressions - If the input is legal, your program should output the final result of the expression evaluation, as given in the above case. If the input is illegal, the result is undefined, i.e., you..

  Data set containing an unknown number of integers

The program should use I/O redirection to accept a file defined by the user which is a data set containing an unknown number of integers. The integers should be stored in an array, and printed to an output file - also defined by the user through r..

  Create the logic for the application fast-food resturant

Create the logic for the application which permits a user to enter the ordered item continuosly until sentinel value is entered.

  Write application to inputs ten numbers from user

Write the application to inputs ten numbers from user, each number can be between 10 and 100, inclusive. As each number is read in determine if it is number already entered.

  Create set-list of enumerated constants called week

Create set/list of enumerated constants called week which contains days of week. Have variable called today that is of kind week. Allot a value to today.

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