Create function to display the planets

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

Rewrite the following code and create function to display the planets and their diameters. Instead of the code in main, create the function to this. Pass both arrays to the function.
static void Main(string[] args)
{
string[] planet = new string[]{"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"};
double[] diameter = new double[] { 4879, 12104, 12756, 6792, 142984, 120536, 51118, 49528 };
Console.WriteLine("Each planet and its diameter are shown below:");
for(int i=0;i<8;i++)
{
Console.Write("nPlanet: "+planet[i]);
Console.Write("tDiameter: "+diameter[i]);
}
Console.ReadLine();


}
}

Reference no: EM131743090

Questions Cloud

How were their views of america similar and dissimilar : How were their views of America similar and dissimilar, Expatriate writers left America and wrote of being American from afar
Intialize the pointer array with the sequence : Assist you when completing your Programming Using Arrays and Pointers assignment
Determine in what ways the u.s. government currently tries : examples that support your viewpoint. Determine in what ways the U.S. government currently tries to support the arts
Explain which of the hr practices described in given case : Explain which of the HR practices described in the case you think can contribute to ethical behavior by TSA employees. Why?
Create function to display the planets : Create function to display the planets and their diameters. Instead of the code in main, create the function to this. Pass both arrays to the function
Analysis in relation to the article you have chosen : This section of the assignment is your own analysis in relation to the article you have chosen
Exercise to include an array of shareholders : Java program from exercise to include an array of Shareholders. As each Shareholder object is created from the file place it into the array of Shareholders.
Why do marketing professionals care about : Why do marketing professionals care about and participate in supply chain decisions? Do you think small business owners are at a disadvantage.
What are the common elements that bind all stories : What are the common elements that bind all these stories, What are the differences

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a c program that reads a data file of floating numbers

Write a program that reads a data file of floating numbers into an array and prints the array elements along with the number of items in the array

  Program which opens a data file and displays its content

writing a C++ program which opens a data file and then displays its contents with line numbers. That is the program should display the number 1 and then the first line of the file, then the number 2 and the second line of the file, etc.

  Explain in a one to two 1-2 page narrative a use case

as an intern software developer for a retail bank you have been tasked with developing use cases to support the atm

  Determine the average number of probes that each search algo

Determine the average number of probes that each search algorithm took. Do these values represent the theoretical values? Print out the averages for the two searches and their theoretical values.

  The factorial of a positive integer n, denoted by n!

Write a program that computes the sequence of factorial values: 1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120, 6! = 720, ....

  Write a program to test the class myarray

Write a program to test the class myArray. C++ Design and implement the class myArray that solves the array index out of bounds problem and also allows the user to begin the array index starting at any integer.

  Write a c function to find the norm of a matrix

Write a C function to find the norm of a matrix. The norm is defined as the square root of the sum of squares of all elements in the matrix. Write your own code please.

  Implement an overloaded assignment operator for point class

Implement an overloaded assignment operator = for the Point class. Implement overloaded stream insertion operator for the Point class. Implement overloaded comparison operators == and != for the Point class

  What is a c-string

What is a C-string? What are some of the similarities and differences between a character array and a C-string

  Explain the two different uses of the keyword virtual

Explain the two different uses of The keyword virtual

  Conversion of programming languages

How to convert java proram into C++ program.

  Program that numerically sums up the infinite series

Write a C program that numerically sums up the infinite series: \(1 + \frac{1}{2^{2}}\frac{1}{3^{2}}\frac{1}{4^{2}}+...\) This is what I have so far, but its not working:

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