Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You will share and communicate with your fellow students to solve a programming

ID: 3593096 • Letter: Y

Question

You will share and communicate with your fellow students to solve a programming problem. The instructor will assign you to a group. Within your group you can set up a group Webex, chat, Skype, or other communication tool to determine the answer to the problem. Each person will contribute to the collaboration project to solve this project and a Word document must be submitted. The Word document will contain these elements:

Names of all group members and how each participated,

Problem statement,

Problem Solution including code and screenshots, and

Conclusions.

As this fluid and experiential forum takes place, students will demonstrate resilience and adaptability to change as well as open minded towards experimentation and evaluation.

Contributions to the collaborative learning environment every other week of the course with fellow classmates is key to enriching the dialogue of what is relevant in today's computing climate.

Active participation is expected, but the quality, not the quantity, is the key to creating a successful collaborative learning environment for everyone. Instructional approaches for this course are highly interactive and experiential.

The assignment is below:

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(" Diameter: "+diameter[i]);

}

Console.ReadLine();

}

}

Explanation / Answer

using System.IO;
using System;

class Program
{
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 };

display(planet, diameter);

}
static void display(string[] planet, double[] diameter ) {
Console.WriteLine("Each planet and its diameter are shown below:");
for(int i=0;i<planet.Length;i++)
{
Console.Write(" Planet: "+planet[i]);
Console.Write(" Diameter: "+diameter[i]);
}
Console.ReadLine();

}

}

Output:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote