Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Rewrite the following code and create a function to display the planets and their diameters. Instead of the code in main, create a function to

Rewrite the following code and create a function to display the planets and their diameters. Instead of the code in main, create a function to do 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(" Planet: "+planet[i]);

Console.Write("\tDiameter: "+diameter[i]);

}

Console.ReadLine();

}

}

need a conclusion statement on this as well. thanks.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions