Describe at least three changes that would make it easier

Assignment Help Basic Computer Science
Reference no: EM13706566

Question: Although the subsequent code compiles and runs, the programmer broke some major readability rules.

Describe at least three changes that would make it easier for other programmers to read and understand the code.

class Program { static void Main() //TBD

{

   double count;

   double Double = 10; // declare variables

   for(int i = 0;i < Double;i++) //keep doing

        {

            count=function(i);

            Console.WriteLine(count);

        }

        Console.Read();

        }

        public static double function(int a) //a function

        {

        return (Math.Sqrt(a));

        }

   }

I am having difficulty with this program because I do not know where to start with.

Reference no: EM13706566

Questions Cloud

Kinds of functionality in the graphical sense : You have to be familiar with the "Fun" part of Java utilizing the GUI. - Why do you think Java and Java's GUI are so popular?
What is the fragmentation : A system uses a page size of the 4 Kbytes and a program size of 46 kbytes is allocated memory. What is the fragmentation?
Show the source code for console application : Show the source code for a C# console application named"MyName" that prints your last name, a tab, and then your first name.
Show the performance improvement over scalar pipeline : Show the performance improvement over scalar pipeline processing and no-pipeline processing, assuming an instruction cycle similar to figure 4.1 in the commentary, i.e.:
Describe at least three changes that would make it easier : Although the subsequent code compiles and runs, the programmer broke some major readability rules -  Describe at least three changes that would make it easier for other programmers to read and understand the code.
Explain how parameter passing by value and by reference : Briefly explain how parameter passing by value and by reference is accomplished in memory. Write statement 1 to call Method A below.
Develop game using the concepts of cohesion : Develop any game of your choice using the concepts of Cohesion, Coupling and RDD, i.e., responsibility-driven design.
What is the frequency of its third harmonic : What is the total average power for a commercial AM transmitter with an un-modulated carrier power of 20 kW and 100% modulation - What is the frequency of its third harmonic?
Implement a java program that generates the receipt : Create a Receipt class that could be used by an automobile parts store. Items to include as data members are receipt number date of purchase, customer number, customer name and address, customer phone number, item number, description, unit price, ..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Explain at least one 1 possible effect that multithreading

question 1 describe at least one 1 possible effect that multithreading could have on event-driven programming when you

  Display the total sales with ah dollar sign

Display the total sales with ah dollar sign and two decimal places. I have no idea how to code this add button.The code has to work for Visual Basic. Thank you.

  Write a program that reads a value

Write a program that reads a value (say n) from the user and ouputs "Hello world" n times. Verify that the user has entered an integer. If the input is 3, the output will be "hello world" 3 times.

  Compute the fraction of time mary spends using her telephone

Assuming a single-server limited-capacity Bernoulli queuing process with 1-minute frames, compute the fraction of time Mary spends using her telephone.

  Cores on computer systems

Cores on Computer Systems

  What is the swap space amount for the bash command

If using a long listing and no process modifiers, what is the swap space amount for the bash command?

  Write a program that asks the user for names of two files

write a program that asks the user for the names of two files. the first file should be opened for reading and the second file should be opened for writing . the program should read the contents of the first file, change all characters to uppercas..

  Dealership is moving into a newly built facility in a suburb

America One Car (AOC) dealership is moving into a newly built facility in a suburb town of Washington, D.C.. You are retained as a consultant by AOC dealership to design a network solution for their new location. The new facility is assumed to..

  Find probability of having no umbrella if it rains

When rain is forecast, Mr. Pickwick takes his umbrella. When rain is not forecast, he takes it with  probability 1/3. Find the probability that Pickwick has no umbrella, given that it rains.

  What makes these pairs transitive

What I dont understand is how these pairs are considered transitive. My question is what makes these pairs transitive?

  Mechanism that one app uses

What is the mechanism that one app uses to signal to another app that its cooperation is requested to accomplish something.

  Define a class called blogentry

Define a class called BlogEntry that could be used to store an entry for a Web log. The class should have instance variables to store the poster's username, text of the entry, and the date of the entry using the Date class.

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