1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Scorpion4ik [409]
3 years ago
7

Give the difference betewen recursion and interation in C. Sight what are the advantages and their disadvantages?

Computers and Technology
1 answer:
mrs_skeptik [129]3 years ago
8 0
I believe you mean iteration. Recursion is when you have a function that calls or uses it's self. it's advantageous because it reduces the amount of code but can fall victim to an endless loop. Iteration is using a while loop or any kind of loop to iterate through a data set normally an array, iteration allows you to do an action for every iterated item but a downside is that it takes a long time to iterate and it is not efficient
You might be interested in
This type of peripheral is used to interact with, or send data to, the computer.
9966 [12]
The Input is what that is for
6 0
3 years ago
Read 2 more answers
Which tool can effectively increase the curl of the subject’s lips?
Lynna [10]
I don’t know if you will get this right but

I think it can be A , or. D
4 0
3 years ago
Read 2 more answers
Part 1: Create an application that allows you to enter student data that consists of an ID number, first name, last name, and gr
aleksley [76]

<u>PART A</u>

import java.io.*;

import java.util.Scanner;

public class StudentsStanding {

   private static final double CUT_OFF = 2.0;

   public static void main(String[] args)

   {

       try {

           PrintWriter goodFile = new PrintWriter(new FileWriter("goodStanding.txt"));

           PrintWriter probationFile = new PrintWriter(new FileWriter("probation.txt"));

           char choice;

           String firstName,lastName;

           Scanner input = new Scanner(System.in);

           int id;

           double gradePoint;

           do {

               System.out.print("Enter student Id: ");

               id = input.nextInt();

               input.nextLine();

               System.out.print("Enter First name: ");

               firstName = input.nextLine();

               System.out.print("Enter last name: ");

               lastName = input.nextLine();

               System.out.print("Enter grade point: ");

               gradePoint = input.nextDouble();

               if(gradePoint<CUT_OFF)

                   probationFile.println(id+","+firstName+","+lastName+","+gradePoint);

               else

                   goodFile.println(id+","+firstName+","+lastName+","+gradePoint);

               System.out.print("Do you want to continue..(y/n): ");

               choice = input.next().toLowerCase().charAt(0);

           }while (choice!='n');

           //close the streams

           goodFile.close();

           probationFile.close();

       }

       catch (IOException ex)

       {

           System.err.println("IO Exception occurs...");

       }

   }

}

<u>PART 2</u>

import java.io.File;

import java.io.FileNotFoundException;

import java.util.Scanner;

public class StudentsStanding2 {

   private static final double CUT_OFF = 2.0;

   public static void main(String[] args)

   {

       String header = "ID\t"+"First Name"+"\t"+"Last Name"+"\t"+"Grade Point"+"\t"+"Exceeds/Fall\n";

       try {

           Scanner probationFile= new Scanner(new File("probation.txt"));

           Scanner goodFile = new Scanner(new File("goodStanding.txt"));

           System.out.println("Cut Off is: "+CUT_OFF);

           System.out.println(header);

           double point ,exceed;

           while (probationFile.hasNextLine())

           {

               String[] tokens = probationFile.nextLine().split(",");

               point = Double.parseDouble(tokens[3]);

               exceed = CUT_OFF-point;

               System.out.println(String.format("%4s %7s %10s %10s %10s",tokens[0],tokens[1],tokens[2],point,String.format("%.2f",exceed)));

           }

           //Close the stream

           probationFile.close();

           while (goodFile.hasNextLine())

           {

               String[] tokens = goodFile.nextLine().split(",");

               point = Double.parseDouble(tokens[3]);

               exceed = point - CUT_OFF;

               System.out.println(String.format("%4s %7s %10s %10s %10s",tokens[0],tokens[1],tokens[2],point,String.format("%.2f",exceed)));

           }

           goodFile.close();

       }

       catch (FileNotFoundException ex)

       {

           System.err.println("File not found!!!");

       }

   }

}

6 0
3 years ago
Match each method of communication with its intended purpose.
Scorpion4ik [409]

Answer:

1. a late breaking news story = to inform

2. a poetry reading = to entertain

3. an advertisement = to persuade

4. a small group assignment = to collaborate

Explanation:

1. A "breaking news" tells people of what is happening in the society. It <em>informs </em>them of the occurrence of an important event such as the plane crash of Kobe Bryant.

2. Poetry reading is meant to touch the attention of listeners. It tries to entertain them through the poem's interesting verses.

3. An advertisement is being shown/displayed in order to convince people to buy a particular product or service.

4. A group assignment allows the members of the group to contribute their ideas together. Such situation is known as "collaboration." They try to brainstorm together towards a common goal.

7 0
3 years ago
The layout gallery displays 10 slide layouts with a variety of placeholders to define text and content positioning and formattin
Papessa [141]
The above statement is FALSE.

The layout gallery displays 9 slide layouts NOT 10. 

These 9 layouts have various<span> placeholders to define text and content positioning and formatting.

</span>1 - Title slide
2 - Title and content
3 - Section Header
4 - Two content
5 - Comparison
6 - Title only
7 - Blank 
8 - Content with Caption
9 - Picture with Caption
8 0
3 years ago
Other questions:
  • Hardy doesn't have access to a work template, which is on the network server. What should he do?
    14·1 answer
  • Once you have selected the range of cells for your table data, from which tab can you open the Insert Table dialog box?
    6·2 answers
  • Write a calculator program that keeps track of a subtotal like real calculators do. Start by asking the user for an initial numb
    12·1 answer
  • Managers looking for advice on properly dealing with obsolete technology hardware can: a) consult the e-Stewards program b) seek
    9·1 answer
  • Plz tell me how to get my deleted account back you will be highly PRAISED!!!!!!!!!!
    14·2 answers
  • Can you give an example of mail merge (letter) pls​​
    6·1 answer
  • + Use for loop to print numbers from 100 to 10
    11·1 answer
  • How to get bing with any node unblocker
    10·2 answers
  • Leon wants an output from his tablet. What should he look at?
    9·1 answer
  • Which of the following is not a common input device?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!