Write program that outputs to a listbox first hundred emirps

Assignment Help Programming Languages
Reference no: EM131757634

Assignment

Part 1:

In your program, write a method that accepts a positive integer and returns true if the number is a prime number and false otherwise. Note that 2 is the only even prime number. An odd integer is prime if it not divisible by any odd integer less than or equal to the square root of the number.

Part 2:

A prime number whose reversal is also a prime number is called emirp. For example, 11, 13, 79 and 359 are emirps. Write a program that outputs to a ListBox the first 100 emirps. Your program must contain the method from Part 1 that returns true if a number is prime; false otherwise and another method that returns the reversal of a positive number. You can reverse the integer in the following way:

• Convert the integer into a string
value = num.ToString();

• Use the following code to reverse the integer
string newNum = "";
for (int l = value.Length; l > 0; l--)
newNum = newNum + value[l-1];

Also, your program should have a TextBox that will accept a positive integer from the user and then display whether the positive integer if an emirp.

Part 1:

In your program, write a method that accepts a positive integer and returns true if the number is a prime number and false otherwise. Note that 2 is the only even prime number. An odd integer is prime if it not divisible by any odd integer less than or equal to the square root of the number.

Part 2:

A prime number whose reversal is also a prime number is called emirp. For example, 11, 13, 79 and 359 are emirps. Write a program that outputs to a ListBox the first 100 emirps. Your program must contain the method from Part 1 that returns true if a number is prime; false otherwise and another method that returns the reversal of a positive number. You can reverse the integer in the following way:

• Convert the integer into a string

value = num.ToString();

• Use the following code to reverse the integer

string newNum = "";
for (int l = value.Length; l > 0; l--)
newNum = newNum + value[l-1];

Also, your program should have a TextBox that will accept a positive integer from the user and then display whether the positive integer if an emirp.

Reference no: EM131757634

Questions Cloud

Explain the role of the mediator in a mediation : Why is managing your biases an important component of facilitation? What biases do you have to overcome? Provide examples.
Estimate for external financing required : Suppose you constructed a pro forma balance sheet for a company and the estimate for external financing required was greater than zero.
Discuss health insurance for the entire family : health insurance for the entire family through Jordans employer
What is the company cost of equity capital : The Lenzie Corporation's common stock has a beta of 1.80. If the risk-free rate is 4.9 percent and the expected return on the market is 11 percent
Write program that outputs to a listbox first hundred emirps : Write a program that outputs to a ListBox the first 100 emirps. Your program must contain the method from Part 1 that returns true if a number is prime.
Develop a potential solution using concepts or strategies : Develop a potential solution using concepts or strategies from the course textbook and additional scholarly sources from the CSU-Global library.
Explain the rules to state the probabilities : You graduate and get hired at a management-consulting firm. On your first project, the decision maker says "I cannot assign a probability to the outcomes.
What is the geometric average return on stock : A stock had the following prices and dividends. What is the geometric average return on this stock?
What is the company current stock price : What is the company's current stock price? What is expected stock price in 5 years?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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