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
MaRussiya [10]
3 years ago
5

In this program we are going to practice using the Math class by computing some important values on the unit circle. Using the a

ngles 0, PI/2, and PI, print out the angle, the cosine of the angle, and the sine of the angle.
Computers and Technology
1 answer:
san4es73 [151]3 years ago
5 0

Answer:

The program in Java is as follows:

import java.lang.Math;

public class Trig{

public static void main(String args[]){

for(double angle = 0; angle <= Math.PI; angle += Math.PI / 2){

double cosX = Math.round(Math.cos(angle)*100.0)/100.0;

double sinX = Math.round(Math.sin(angle)*100.0)/100.0;

System.out.println((Math.round(angle*100)/100.0)+" --> "+cosX +" --> "+ sinX);

}}}

Explanation:

This line imports the math library into the program

import java.lang.Math;

This line defines a class

public class Trig{

This line defines the main method

public static void main(String args[]){

This line is an iteration that iterates from 0, through Math.PI using Math.PI/2 as an interval

for(double angle = 0; angle <= Math.PI; angle += Math.PI / 2){

This calculates the cosine of the angle (in radians)

double cosX = Math.round(Math.cos(angle)*100.0)/100.0;

This calculates the sine of the angle (in radians)

double sinX = Math.round(Math.sin(angle)*100.0)/100.0;

This prints the angle in radians, the cosine and the sine of the angle

System.out.println((Math.round(angle*100)/100.0)+" --> "+cosX +" --> "+ sinX);

}}}

You might be interested in
A network systems administrator would most likely help with
suter [353]
<span> Network and computer systems administrators are responsible for the day-to-day operation of these networks. They organize, install, and support an organization’s computer systems, including local area networks (LANs), wide area networks (WANs), network segments, intranets, and other data communication systems.</span>
8 0
3 years ago
Read 2 more answers
The type of wireless access that uses a modem to connect to cell towers is called ___
Alex_Xolod [135]

Answer:

What are the Wireless Broadband Technologies?

What are the Wireless Broadband Technologies?

Wireless broadband services are similar to wired broadband in that they connect to an internet backbone usually a fiber-optic trunk; however they don’t use cables to connect to the last mile or business/residences. Instead they use Wireless Fidelity (Wi-Fi) connections or radio waves. A computer or mobile device has a wireless adapter that translates data into a radio signal and transmits the signal using an antenna. A wireless router receives the signal, decodes it and then sends it to the Internet through a wired Ethernet connection.

Fixed wireless is a type of high-speed Internet access where connections to service providers use radio signals rather than cables. Fixed wireless offers connections speeds between 1 and 10 mbps and use transmission towers similar to cell phone towers that communicate to a resident’s transceiver equipment that, as the name implies is fixed at the premise. The transceiver equipment communicates with the providers’ ground stations.

Wireless fidelity (Wi-Fi) is a fixed, short-range technology that is often used in combination with DSL, fixed wireless, fiber, or cable modem service to connect devices within a home or business to the Internet using a radio link between the location and the service provider’s facility. Wi-Fi service can be available in your home or at community locations (airports, coffee shops, schools, businesses, etc.) and are often called “hotspots.” A Wi-Fi network uses radio waves, similar to two-way radio communications. A computer has a wireless adapter that translates data into a radio signal and transmits it using an antenna. A router receives the signal, decodes it, and then sends the information to the Internet using a physical connection, usually via an Ethernet cable, a cable that carries the broadband signal between the modem, router, computer, and other wired Internet capable devices.

Mobile Wireless (3G, 4G)

Mobile wireless is high-speed wireless broadband connection that is accessible from random locations. The locations depend on the provider’s cellular towers and monthly service plans. Many technologies make up wireless networks, but no matter the technology or acronyms you read or hear, mobile wireless networks are radio systems.

Mobile wireless services are continually being upgraded to provide data transmission speeds considered to be broadband. The faster mobile wireless networks are referred to as 3G or 4G.The “G” stands for “generation,” meaning 3rd and 4th generation or the evolution of broadband cellular networks; supposedly, each generation provides a faster more secure wireless network. A mobile wireless service requires a base station that is connected to a high capacity landline data transmission network to reach the Internet. In other words, it’s never wired OR wireless; ultimately, it has to be both. Wireless broadband in common usage means that the so-called “last mile” connection to the user is done via radio signals from a tower to a cell phone or other wireless devices (e.g., a tablet).

Long Term Evolution (LTE)

LTE is a 4G technology provides increased peak data rates, reduced latency, scalable bandwidth capacity than 4G predecessors. LTE can manage multi-cast and broadcast streams and handle quick-moving mobile phones. It uses an IP-based network architecture that allows for seamless handovers for voice and data to older model cell towers.

Satellite

Satellite broadband is sometimes the only option available to users in very rural or sparsely populated areas. Like telephone and television services, satellites orbiting the earth provide necessary links for broadband. With satellite service, you must have a clear view of the southern sky. Satellite service can be disrupted by weather conditions and changes in line of sight to the orbiting satellite. Satellite may have a higher monthly service charge than other broadband options and the need to purchase more home or business equipment compared to the other options. Because satellites are located a significant distance from customers, there are issues of “latency” and therefore a noticeable time lag between sending and receiving data by the end customer.

Downstream and upstream speeds for satellite broadband depend on several factors, including the provider and service package purchased the consumer’s line of sight to the orbiting satellite, and the weather. Satellite speeds may be slower than DSL and cable modem, but they can be about 10 times faster than the download speed with dial-up Internet access. Service can be disrupted in extreme weather conditions.

Source: Information from Wisconsin’s Broadband Reference Guide produced by: WI Public Service Commission, UW-Extension Madison, and the Center for Community Technology Solutions, January 2014

Explanation:

8 0
3 years ago
We need an equals method for the Dog class. It needs to give back to the caller a boolean value indicating whether another objec
Nadusha1986 [10]

Answer and Explanation:

Using Javascript:

Class Dog{

var healthScores=[];

Constructor(name, age, ...healthScores) {this.name=name;

this.age=age;

this.healthsScores=healthScores;

}

checkObject(new Dog){

If(new Dog.name===this.name,new Dog.age===this.age, new Dog.healthScores===this.healthScores){return true;

}

else{

console.log("objects are not equal");

}

}

}

To call the method checkObject:

var Tesa = new Dog(Tes,1,[45,46,82]);

var Bingo = new Dog(bing,2,[43,46,82]);

Bingo.checkObject(Tesa);

Note: we have used ES6(latest version of Javascript) where we passed the healthScore parameter(which is an array) to our constructor using the spread operator.

3 0
3 years ago
What is the importance of computers in the communication industry?
muminat

Answer:

because computer is the centerpiece of information technology.

8 0
3 years ago
Read 2 more answers
Write a program that allows the user to enter the last names of five candidates in a local election and the number of votes rece
amm1812

Answer:

a= input("Enter the last name of first candidate: ")

aVotes= int(input("Enter Number of votes cast for "+ a + ": "))

b= input("Enter the last name of second candidate: ")

bVotes= int(input("Enter Number of votes cast for "+ b + ": "))

c= input("Enter the last name of third candidate: ")

cVotes= int(input("Enter Number of votes cast for "+ c + ": "))

d= input("Enter the last name of fourth candidate: ")

dVotes = int(input("Enter Number of votes cast for "+ d + ": "))

e= input("Enter the last name of fifth candidate: ")

eVotes = int(input("Enter Number of votes cast for "+ e + ": "))

votes= [aVotes,bVotes,cVotes,dVotes,eVotes]

aPercent= (round((aVotes/sum(votes))*100, 2))

bPercent= (round((bVotes/sum(votes))*100, 2))

cPercent= (round((cVotes/sum(votes))*100, 2))

dPercent= (round((dVotes/sum(votes))*100, 2))

ePercent= (round((eVotes/sum(votes))*100, 2))

print( a, ":", aVotes,"Votes", aPercent,"%")

print( b, ":", bVotes,"Votes", bPercent,"%")

print( c, ":", cVotes,"Votes", cPercent,"%")

print( d, ":", dVotes,"Votes", dPercent,"%")

print( e, ":", eVotes,"Votes", ePercent,"%")

winner= max(votes)

if winner==aVotes:

   print(a," is the Winner")

elif winner==bVotes:

   print(b," is the Winner")

elif winner==cVotes:

   print(c," is the Winner")

elif winner==dVotes:

   print(d," is the Winner")

elif winner==eVotes:

   print(e," is the Winner")

else:

   None

Explanation:

  • First section

<em> a= input("Enter the last name of first candidate: ") </em>

<em>aVotes= int(input("Enter Number of votes cast for "+ a + ": ")) </em>

<em>b= input("Enter the last name of second candidate: ") </em>

<em>bVotes= int(input("Enter Number of votes cast for "+ b + ": ")) </em>

<em>c= input("Enter the last name of third candidate: ") </em>

<em>cVotes= int(input("Enter Number of votes cast for "+ c + ": ")) </em>

<em>d= input("Enter the last name of fourth candidate: ") </em>

<em>dVotes = int(input("Enter Number of votes cast for "+ d + ": ")) </em>

<em>e= input("Enter the last name of fifth candidate: ") </em>

<em>eVotes = int(input("Enter Number of votes cast for "+ e + ": ")) </em>

Collects the last name and the number of  votes cast

  • Second section

<em>votes= [aVotes,bVotes,cVotes,dVotes,eVotes] </em>

<em />

places all the votes in a list.

The reason for this is to allow us use the "sum function" and "max function", to get the sum of all the votes.

  • Third section

<em>aPercent= (round((aVotes/sum(votes))*100, 2)) </em>

<em>bPercent= (round((bVotes/sum(votes))*100, 2)) </em>

<em>cPercent= (round((cVotes/sum(votes))*100, 2)) </em>

<em>dPercent= (round((dVotes/sum(votes))*100, 2)) </em>

<em>ePercent= (round((eVotes/sum(votes))*100, 2)) </em>

calculates the percentage of all the votes cast for the individual candidates

  • Fourth section

<em>print( a, ":", aVotes,"Votes", aPercent,"%") </em>

<em>print( b, ":", bVotes,"Votes", bPercent,"%") </em>

<em>print( c, ":", cVotes,"Votes", cPercent,"%") </em>

<em>print( d, ":", dVotes,"Votes", dPercent,"%") </em>

<em>print( e, ":", eVotes,"Votes", ePercent,"%") </em>

prints out the candidates name, number of votes received and the percentage

  • Fifth section

winner= max(votes)

gets the maximum votes cast

  • Sixth Section

if winner==aVotes:

   print(a," is the Winner")

elif winner==bVotes:

   print(b," is the Winner")

elif winner==cVotes:

   print(c," is the Winner")

elif winner==dVotes:

   print(d," is the Winner")

elif winner==eVotes:

   print(e," is the Winner")

else:

   None

uses if statements to compare the maximum votes with the votes gotten by all the candidates to get a winner

4 0
3 years ago
Other questions:
  • If you feel that an OSHA inspection is needed to get hazards corrected at your workplace, which is your best option?
    7·1 answer
  • Which of the following is the MOST likely cause of the connectivity issues?A user of the wireless network is unable to gain acce
    5·1 answer
  • The ____ operator executes one of two expressions based on the results of a conditional expression. Group of answer choices
    15·2 answers
  • A computer processes data using only 1s and 0s true or false?
    9·2 answers
  • How do i make a profile picture <br> REALLY URGENT I NEED IT NOW!!!
    8·2 answers
  • The if statement regards an expression with the value 0 as __________.
    13·1 answer
  • What is a feature of Print Preview?
    14·1 answer
  • Does anyone know how to delete a question you put up? I'll give you 20 points.
    8·1 answer
  • ____ can be used to break continuous text to one or more sentences​
    7·1 answer
  • Which sql keyword is used to retrieve a minimum value from an attribute in a table
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!