Write a method that accept positive integer and returns true

Assignment Help C/C++ Programming
Reference no: EM131752729

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.

Part2:

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.

Program Description: You write a short description of what the program will do

In addition to using a ListBox for the output of the 100 emirps, also write these values to an output file. Add this as a method. You should use the values from the ListBox as output to the file.

Reference no: EM131752729

Questions Cloud

Calculate the maximum cca : Calculate the maximum CCA that can be claimed in 2015 and 2016 related to this machine.
Define worldwide approach in taxing foreign source income : Assume that U.K. employs the worldwide (nationality) approach in taxing foreign source income and has FTC provisions similar to those in the U.S. Further.
How many different types of immunity are there : When we say that we are immune to a specific infectious agent, what are we talking about? How many different types of immunity are there?
Purchase a put option on stock : If she decides to purchase a put option on this stock at an exercise price of $27.5, the fair price to pay is
Write a method that accept positive integer and returns true : In your program, write a method that accepts a positive integer and returns true if the number is a prime number and false otherwise.
Prepare master budget including a budgeted income statement : Prepare a master budget including a budgeted income statement, balance sheet, statement of cash receipts and disbursements
What is the unit product cost : Assume that Wilson company produces a single product that has a per unit cost of $363 for direct materials and $44 directlabor.
Identify the most important information you would want : Describe the community involvement (e.g., remediation strategies, current stage of cleanup at the site, etc.) in the discovery or cleanup of the site.
Defined contribution pension : Assume John has a defined contribution pension that he contributes 5% to and his employer matches this amount. John's salary in 2017 is $5,000 per month.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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