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
mash [69]
2 years ago
10

Write a program, called compute_stats.c, which opens a data file, called numbers.txt, which contains of a list of positive integ

ers, computes their sum and product, finds the largest number, and writes the results to an output file called statistics.txt. Test your program by creating a numbers.txt file and by inserting several number combinations in this file
Computers and Technology
1 answer:
oksano4ka [1.4K]2 years ago
7 0
??????????????????????
You might be interested in
A blue NFiPA label indicates: A) Health Hazard B) Special information C) Flammability D) Reactivity
elena55 [62]
Your answer would be A: Health Hazard
8 0
2 years ago
Read 2 more answers
Add my sna-p dkarpik58?...
BARSIC [14]

<u><em>This is for answers not snap</em></u>

7 0
3 years ago
Test unit 8 edhesive answers ​
True [87]
What are the questions
7 0
2 years ago
Give 5 comparisons of the three employees with the highest net pay
Anna71 [15]

Answer:

this is wot u get for not paying attiention on class

Explanation:

3 0
2 years ago
Read 2 more answers
In this scenario, two friends are eating dinner at a restaurant. The bill comes in the amount of 47.28 dollars. The friends deci
pickupchik [31]

Answer:

The java program for the given scenario is as follows.

import java.util.*;

import java.lang.*;

public class Main

{

   //variables for bill and tip declared and initialized

   static double bill=47.28, tip=0.15;

   //variables for total bill and share declared

   static double total, share1;

public static void main(String[] args) {

    double total_tip= (bill*tip);

    //total bill computed

    total = bill + total_tip;

    //share of each friend computed

    share1 = total/2;

    System.out.printf("Each person needs to pay: $%.2f", share1);  

}

}

Explanation:

1. The variables to hold the bill and tip percent are declared as double and initialized with the given values.

static double bill=47.28, tip=0.15;

2. The variables to hold the values of total bill amount and total tip are declared as double.

3. All the variables are declared outside main() and at class level, hence declared as static.

4. Inside main(), the values of total tip, total bill and share of each person are computed as shown.

double total_tip= (bill*tip);

total = bill + total_tip;

share1 = total/2;

5. The share of each person is displayed to the user. The value is displayed with only two decimal places which is assured by %.2f format modifier. The number of decimal places required can be changed by changing the number, i.e. 2. This format is used with printf() and not with println() method.

System.out.printf("Each person needs to pay: $%.2f", share1);  

6. The program is not designed to take any user input.

7. The program can be tested for any value of bill and tip percent.

8. The whole code is put inside a class since java is a purely object-oriented language.

9. Only variables can be declared outside method, the logic is put inside a method in a purely object-oriented language.

10. As shown, the logic is put inside the main() method and only variables are declared outside the method.

11. Due to simplicity, the program consists of only one class.

12. The output is attached.

5 0
3 years ago
Read 2 more answers
Other questions:
  • What is life all about?
    15·2 answers
  • All languages from the second generation on must be translated into machine language for the computer to be able process the inp
    8·1 answer
  • During the past decade ocean levels have been rising faster than in the past, an average of approximately 3.1 millimeters per ye
    14·1 answer
  • What is working with others to find a mutually agreeable outcome?
    6·1 answer
  • Browsing the web is one of the most common activities performed by individuals who use computers.
    12·1 answer
  • Which tool can you use in spreadsheet software to display only specific data values?
    9·1 answer
  • What are some pros for having your phone during school hours?
    10·2 answers
  • Hi whats airpods good for
    15·2 answers
  • Tell me the most scariest website you know and i'll give you brainlest
    5·1 answer
  • The excerpt is a sample works-cited list.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!