Prime Numbers. Write a program that reads in an integer that is greater than 2 (let’s call it k) and finds and prints all of the prime numbers between 3 and k.

C++

LANGUAGE: C++ CHALLENGE: Prime Numbers. Write a program that reads in an integer that is greater than 2 (let’s call it k) and finds and prints all of the prime numbers between 3 and k. A prime number is a number such that 1 and itself are the only numbers that evenly divide it (for…

Read More

Design and implement a class called Box that contains instance data that represents the height, width, and depth of the box.

java

LANGUAGE: Java CHALLENGE: Design and implement a class called Box that contains instance data that represents the height, width, and depth of the box. These dimensions should be of a type that can represent linear measurements, including fractional ones. Also include a boolean variable called full as instance data that represents whether the box is…

Read More

Design and implement a class called Car that contains instance data that represents the make, model, and year of the car

java

LANGUAGE: Java CHALLENGE: Design and implement a class called Car that contains instance data that represents the make, model, and year of the car (as a String, String and int value respectively). Define the Car constructor to initialize these values (in that order). Include getter and setter methods for all instance data, and a toString…

Read More

Design and implement a class called Sphere that contains instance data that represents the sphere’s diameter.

java

LANGUAGE: Java CHALLENGE: Design and implement a class called Sphere that contains instance data that represents the sphere’s diameter. Define the Sphere constructor to accept and initialize the diameter, and include getter and setter methods for the diameter. Include methods calcVolume and calcSurfaceArea that calculate and return the volume and surface area of the sphere.…

Read More