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

  Pseudo code for recursive function to print prime numbers

Write in pseudo code the recursive function which receive 2 integers (a and b) and returns sum of all common prime dividers (1 is not prime).

  Write ipo steps and detailed pseudo code for program

Write IPO steps and detailed pseudo code for program which will ask user to enter restaurant meal cost. The program should then compute the tax, tip on the restaurant bill,

  Write program with procedure which draws shape

Write down program with procedure which draws a shape of your choice. Your program must then call the procedure 10 times to draw the shape at 10 random locations.

  What is the output of the statement

Given the subsequent array declaration, if the array is stored starting at address 2500, what is the output of the following statement?

  Write a windows application in visual basic

The calculator allows a user to eater numeric values via the 0.9 keysibuttoas. Arithmetic functions such as. add. subtract. multiply.

  Calculate and display total fees and discount

Write a program to select type of student using an option button and capture total credit hours using a text box. Calculate and display total fees, discount (if any) and net total fees (after discount).

  Create a class for performing arithmetic with fractions

Create a class called Rational for performing arithmetic with fractions. Write a program to test your class. 1/2+2/3+3/4.......+98/99+99/100.Use integer variables to represent the private data of the class

  Write prolog clauses to define the relationships

Using Prolog, establish a database of facts and rules for the following predicates.

  Write a program to read student data from standard input

Write a program to read student data from standard input, sort it by last name / first name, and print result to standard output.

  Creating webpage using css

In creating a web page, depending on the information you are trying to convey. What are CSS?

  Program to calculate sum of squares using for loop

Given int variables k and total that have already been declared, use for loop to calculate sum of squares of first 50 counting numbers, and store this value in total.

  Program to compute flow of water flowing through a pipe

Write a program to calculate the volume flow rate in cubic feet per second of water flowing through a pipe of diameter d in inches and a velocity of v feet per second.

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