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
Anika [276]
2 years ago
10

Write a program to convert kilometers/hr to miles/hr. The program should produce a table of 10 conversions, starting at 60 km/hr

and incremented by 5 km/hr. The display should have appropriate headings and list each km/hr and its equivalent miles/hr value. Use the relationship that 1 kilometer = 0.6241 miles. Implement this program using the FOR loop. Sample output is given below: write a c++ programe Page 1 of 2 I KM per hour Miles per hour 60 37.4460 65 40.5665 70 43.6870 46.8075 80 49.9288 85 53.0485 90 56.1690 95 59.2895 100 62.4100 105 65.5305​
Computers and Technology
1 answer:
mote1985 [20]2 years ago
7 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   float speed_in_km_per_hr = 60;

   

   // Output table head

   cout << "km/hr  miles/hr." << endl;

   

   for (int i = 0; i < 10; i++)

   {

     // Convert KM/hr to miles/hr

     float speed_in_miles_per_hr = speed_in_km_per_hr * 0.6241;

     

     // Output speeds

     cout << speed_in_km_per_hr << "     " << speed_in_miles_per_hr << endl;

     

     // Increase by 5

     speed_in_km_per_hr = speed_in_km_per_hr + 5;

   }

     

   return 0;

}

Explanation:

You might be interested in
Write a C program to read the values of a 6 x 6 2D array from a file, and then produce an output file that contains the transpos
kvv77 [185]

Answer:

Explanation:

#include <stdio.h>

int main()

{

   int arr[5][5], trans [5][5], i, j;

   // Entering elements to the matrix

   printf("\nEnter matrix elements:\n");

   for (i = 0; i < 6; ++i)

       for (j = 0; j < 6; ++j) {

           printf("Enter element a%d%d: ", i + 1, j + 1);

           scanf("%d", &arr[i][j]);

       }

 

   printf("\nThe given input matrix is: \n");

   for (i = 0; i < 6; ++i)

       for (j = 0; j < 6; ++j) {

           printf("%d  ", arr[i][j]);

           if (j == 5)

               printf("\n");

       }

   // Transpose

   for (i = 0; i < 6; ++i)

       for (j = 0; j < 6; ++j) {

           trans[j][i] = a[i][j];

       }

   printf("\nThe output transpose of the matrix:\n");

   for (i = 0; i < 6; ++i)

       for (j = 0; j < 6; ++j) {

           printf("%d  ", trans[i][j]);

           if (j == 5)

               printf("\n");

       }

   return 0;

}

7 0
3 years ago
Write a program that reads the lengths of the sides of a triangle from the user. Compute the area of the triangle using Heron's
slamgirl [31]

Answer:

The java program is as follows.

import java.util.Scanner;

import java.lang.*;

public class Area

{

   //variables to hold the values

   static double a, b, c;

   static double s;

   static double area;

public static void main(String[] args) {

    //scanner class object created

    Scanner sc = new Scanner(System.in);

 System.out.print("Enter the first side: ");

 a=sc.nextInt();

 System.out.print("Enter the second side: ");

 b=sc.nextInt();

 System.out.print("Enter the third side: ");

 c=sc.nextInt();

 s=(a+b+c)/2;

 //function of Math class used

 area = Math.sqrt( s*(s-a)*(s-b)*(s-c) );

 //result displayed with 3 decimal places

 System.out.printf("The area of the triangle is %.3f", area);  

}

}

OUTPUT

Enter the first side: 1

Enter the second side: 1

Enter the third side: 1

The area of the triangle is 0.433

Explanation:

1. The variables to declare the three sides of the triangle, the semi-perimeter and the area of the triangle are declared with double datatype. All the variables are declared at class level and hence, declared with keyword, static.  

2. Inside main(), an object of the Scanner class is created.

Scanner sc = new Scanner(System.in);

3. Using the Scanner class object, user input is taken for all the three sides of the triangle.

4. Following this, the semi-perimeter is computed as shown.

s=(a+b+c)/2;

5. The area of the triangle is computed using the given formula which is implemented as shown.

area = Math.sqrt( s*(s-a)*(s-b)*(s-c) );

6. The sqrt() method of the Math class is used while computing the area of the triangle.

7. The area is displayed with three decimals. This is done using the printf() method as shown.

System.out.printf("The area of the triangle is %.3f", area);

8. The program is saved with the same name as the name of the class having the main() method.

9. The class having the main() method is always public.

3 0
3 years ago
Several surprising findings were revealed in the wake of the Target breach, providing a cautionary tale for all executives and s
Akimi4 [234]

Answer: (a) Target had security software, but the notification alerts from the software were  ignored.

Explanation:

The security software was there in target but its notification alerts being ignored was something which was not thought to have been occurred during the Target security breach, as anyone could be alerted with the notification alert.

6 0
3 years ago
HELP ASAP- YOU GET BRAINLIEST!!
agasfer [191]

Answer:

BLOb

Explanation:

Binary Large Objects (BLOb) data is capable of storing data in the form of images, audio, and video clips.

3 0
4 years ago
Suppose you have a stack ADT (i.e., an Abstract Data Type that includes operations to maintain a stack. Design a flowchart or su
Whitepunk [10]

Answer:

One approach would be to move all items from stack1 to stack2 (effectively reversing the items), then pop the top item from stack2 and then put them back.

Assume you use stack1 for enqueueing. So enqueue(x) = stack1.push(x).

Dequeueing would be:

- For all items in stack1: pop them from stack1 and push them in stack 2.

- Pop one item from stack2, which will be your dequeue result

- For all items in stack2: pop them from stack2 and push them in stack 1.

Hope it makes sense. I'm sure you can draw a diagram.

5 0
3 years ago
Other questions:
  • 1. Create a view named customer_addresses that shows the shipping and billing addresses for each customer.
    15·1 answer
  • Write a character literal representing the (upper case) letter<br> a.
    13·1 answer
  • Using a loop, write a program that reads in exactly five integers and outputs the sum.
    11·1 answer
  • Your friends parents are worried about going over their budget for the month. Which explains would you suggest is not a need.
    14·2 answers
  • Two users, UserA and UserB, are engaging in secure communication using only asymmetrical encryption. UserA needs to send a secur
    11·1 answer
  • Two columns of a relational table can have the same names. <br> a. True <br> b. False
    15·1 answer
  • The hardware that takes the input data and works with it
    7·1 answer
  • What type of malicious software technology is used to monitor user behavior or gather information about the user, sometimes incl
    5·1 answer
  • A(n) _____ is any group of characters enclosed within either double or single quotation marks in javascript.
    9·1 answer
  • Please answer........
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!