Category: Learn To Code

Declare a two-dimensional character array named “gasgiants” that is capable of storing the names of the gas giant planets of our solar system: jupiter, saturn, uranus, and neptune.

Declare a two-dimensional character array named “gasgiants” that is capable of storing the names of the gas giant planets of our solar system:  jupiter, saturn, uranus, and neptune.

LANGUAGE: C++ CHALLENGE: Declare a two-dimensional character array named “gasgiants” that is capable of storing the names of the gas giant planets of our solar system: jupiter, saturn, uranus, and neptune. Do not make the array any larger than it needs to be.

Read More

Write the definition of a function isMultipleOf, that receives two integer arguments and returns true if the first argument is a multiple of the second. Otherwise false is returned.

Write the definition of a function isMultipleOf, that receives two integer arguments and returns true if the first argument is a multiple of the second. Otherwise false is returned.

LANGUAGE: C++ CHALLENGE: Write the definition of a function isMultipleOf, that receives two integer arguments and returns true if the first argument is a multiple of the second. Otherwise false is returned. So, if the arguments are 27 and 8 the function returns false because 27 is not a multiple of 8. But if the […]

Read More

Given the availability of an ifstream object named input, write the other statements necessary to read an integer into a variable datum that has already been declared from a file called rawdata.

Given the availability of an ifstream object named input, write the other statements necessary to read an integer into a variable datum that has already been declared from a file called rawdata.

LANGUAGE: C++ CHALLENGE: Given the availability of an ifstream object named input, write the other statements necessary to read an integer into a variable datum that has already been declared from a file called rawdata. Assume that reading that one integer is the only operation you will carry out with this file. (Note: write just […]

Read More

Transient Population Populations are effected by the birth and death rate, as well as the number of people who move in and out each year.

Transient Population Populations are effected by the birth and death rate, as well as the number of people who move in and out each year.

LANGUAGE: C++ CHALLENGE: Transient Population Populations are effected by the birth and death rate, as well as the number of people who move in and out each year. The birth rate is the percentage increase of the population due to births and the death rate is the percentage decrease of the population due to deaths. […]

Read More

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.

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.

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

Write a full class definition for a class named GasTank, and containing the following members

Write a full class definition for a class named GasTank, and containing the following members

LANGUAGE: C++ CHALLENGE: Write a full class definition for a class named GasTank, and containing the following members: A data member named amount of type double. A constructor that accepts no parameters. The constructor initializes the data member amount to 0. A function named addGas that accepts a parameter of type double. The value of […]

Read More

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

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

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

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

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.

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

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