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

What type of light comes from reflections off other objects?

Computers and Technology
1 answer:
lina2011 [118]3 years ago
4 0

Answer:

diffused

Explanation:

Diffuse reflection is when light hits an object and reflects in lots of different directions. This happens when the surface is rough. Most of the things we see are because light from a source has reflected off it.

You might be interested in
Which of these statements regarding​ time-cost tradeoffs in CPM networks is​ true?
g100num [7]

Answer:

B. Crashing  is not possible unless there are multiple critical tasks.

8 0
3 years ago
Design and code a program including the following classes, as well as a client class to test all the methods coded:A Passenger c
sergeinik [125]

Answer:

Code given below

Explanation:

/*

* Class to hold the Passenger data

* Stores the name and classOfService

* */

public class Passenger {

  String name;

int classOfService;

  public Passenger(String string, int classOfService) {

      this.name = string;

      this.classOfService = classOfService;

  }

@Override

  public String toString() {

      return "Passenger [name=" + name + ", classOfService=" + classOfService

              + "]";

  }

@Override

  public int hashCode() {

      final int prime = 31;

      int result = 1;

      result = prime * result + classOfService;

      result = prime * result + ((name == null) ? 0 : name.hashCode());

      return result;

  }

@Override

  public boolean equals(Object obj) {

      if (this == obj)

          return true;

      if (obj == null)

          return false;

      if (getClass() != obj.getClass())

          return false;

      Passenger other = (Passenger) obj;

      if (classOfService != other.classOfService)

          return false;

      if (name == null) {

          if (other.name != null)

              return false;

      } else if (!name.equals(other.name))

          return false;

      return true;

  }

  public String getName() {

      return name;

  }

  public int getClassOfService() {

      return classOfService;

  }

}

----

import java.util.ArrayList;

import java.util.List;

/* Train class for holding the

* passengerList.

* The passengerList is the list of Passenger Object

*/

public class Train {

  List<Passenger> passengerList;

  public Train() {

      passengerList = new ArrayList<Passenger>();

  }

  public Passenger getPassenger(int index) {

      if (index <= 0 && getTotalNumberOfPassengersOnBoard() < index) {

          return null;

      } else {

          return passengerList.get(index - 1);

      }

  }

  public void addPassenger(Passenger p) {

      passengerList.add(p);

  }

  public int getTotalNumberOfPassengersOnBoard() {

      return passengerList.size();

  }

  public boolean isPassengerOnBoard(String name) {

      boolean flag= false;

      for (Passenger p : passengerList) {

          if (p.getName().equalsIgnoreCase(name)) {

              flag = true;

              break;

          } else {

              flag = false;

          }

      }

      return flag;

  }

public double getRevenue(double priceFirstClass, double priceSecondClass) {

      double total = 0.0;

      for (Passenger p : passengerList) {

          if (p.getClassOfService() == 1) {

              total += priceFirstClass;

          } else {

              total += priceSecondClass;

          }

      }

      return total;

  }

  public double getPercentageFirstClassTravellers() {

      double count = 0.0;

      for (Passenger p : passengerList) {

          if (p.getClassOfService() == 1) {

              count++;

          }

      }

      return count / getTotalNumberOfPassengersOnBoard() * 100;

  }

@Override

  public String toString() {

      return "Train [passengerList=" + passengerList + "]";

  }

@Override

  public int hashCode() {

      final int prime = 31;

      int result = 1;

      result = prime * result

              + ((passengerList == null) ? 0 : passengerList.hashCode());

      return result;

  }

@Override

  public boolean equals(Object obj) {

      if (this == obj)

          return true;

      if (obj == null)

          return false;

      if (getClass() != obj.getClass())

          return false;

      Train other = (Train) obj;

      if (passengerList == null) {

          if (other.passengerList != null)

              return false;

      } else if (!passengerList.equals(other.passengerList))

          return false;

      return true;

  }

}

-----------

public class TrainTest {

  public static void main(String[] args) {

      Train t = new Train();

      Passenger p1 = new Passenger("James", 1);

      Passenger p2 = new Passenger("Sarah", 2);

      Passenger p3 = new Passenger("Jhon", 1);

      Passenger p4 = new Passenger("Test", 2);

      // add other passengers Test1 .. Test6

      for (int j = 1; j < 7; j++) {

          t.addPassenger(new Passenger("Test" + j, j % 2));

      }

      t.addPassenger(p1);

      t.addPassenger(p2);

      t.addPassenger(p3);

      t.addPassenger(p4);

      System.out.println("total revenue $" + t.getRevenue(10.0, 25.0));

      System.out.println("total number of passengers on Board .. "

              + t.getTotalNumberOfPassengersOnBoard());

      System.out.println("percentage of first class traveller .. "

              + t.getPercentageFirstClassTravellers());

      System.out.println("getPassenger number # 2 .. " + t.getPassenger(2));

      System.out.println("is passenger Jhon on board ? "

              + t.isPassengerOnBoard("Jhon"));

      System.out.println("is passenger Dummy on board ? "

              + t.isPassengerOnBoard("Dummy"));

      System.out.println("Printing all the Passengers on Board ...");

      for (int i = 1; i <= t.getTotalNumberOfPassengersOnBoard(); i++) {

          System.out.println("" + t.getPassenger(i));

      }

     

      // using the the Train toString to print all the passengers from Train

      System.out.println(t.toString());

  }

}

8 0
3 years ago
In early PCs, a DIMM in any one of the DIMM slots could fill the 64-bit bus; therefore, each slot was called a(n) ______________
Svetach [21]

Answer:

The correct answer to the following question will be Option A (Bank).

Explanation:

  • Sometimes on a motherboard, the memory modules are grouped into different groups and that each group is named as a branch. Furthermore, the term "bank" may be used loosely to describe a basic computing data storage area. When the record is stored in the database it can be accessed at a specific time by the user.
  • Because the 486 is a 32-bit processor and a 30-pin SIMM is 8-bit, four SIMMs (8x4=32) is called a bank when installing memory on an 80486 processor computer; Install four 16 MB SIMMs when upgrading to 64 MB. 

Therefore, Option A is the right answer.

3 0
3 years ago
Letter Frequency Write a function that will take a string and return a count of each letter in the string. For example, "my dog
Nostrana [21]

Answer:

Check the explanation

Explanation:

Code to copy:

// ConsoleApplication7.cpp : Defines the entry point for the console application.

//

#include "stdafx.h"

#include <iostream>

#include <cstring>

#include <string>

using namespace std;

int * letterFrequency(char s[]);

int main()

{

  int *freq_letters;

  char *s = new char[100];

  freq_letters = new int[26];

  //To read the input string in order to find the frequency of each letter

  cout << "Enter a string: ";

  cin.getline(s, ' ');

  //call the function to find the occurrence of each alphabet

  freq_letters = letterFrequency(s);

  //Display the count

  cout << "Letter Frequency " << endl;

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

  {

      //Constriant to check if the letter appeared at least once in the string and so printing the frequency of its occurence

      if (freq_letters[i] != 0)

      cout << " " << static_cast<char>(i + 'a') << " " << freq_letters[i] << endl;

  }

  system("pause");

  return 0;

}

//Define the function to find occurrence of each letter in the input string

int * letterFrequency(char s[])

{

  int *occurrence_array;

//to store the output of occurrences for each alphabet

  occurrence_array = new int[26];

// to store the count of occurrence for each letter temporarily

  int letter_count;

  // for loop to check the occurrence for all 26 alphabets

 

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

  {

      letter_count = 0;

      for (int j = 0; j < strlen(s); j++)

      {

          /*comparing the ascii values of each alphabet with every character from the string by converting it to lower case i.e. case insensitive*/

          if (int('a') + i == int(tolower(s[j])))

              letter_count++;

      }

      occurrence_array[i] = letter_count;//To store the count calculated for each alphabet

  }

  return occurrence_array;

}

The following below code screenshot and output shows that when the string is entered, the output will shows each lettercount irrespective of whether the letter is in capitals or small and does not count non-letter characters (i.e spaces, punctuations etc.)

6 0
4 years ago
Variance for accumulator. Validate that the following code, which adds the
Art [367]

Using the knowledge of computational language in JAVA it is possible to write a code that Validate that the following code, which adds the methods var() and stddev() to Accumulator, computes both the mean and variance of the numbers presented as arguments to addDataValue()

<h3>Writting the code:</h3>

<em>import java.util.*;</em>

<em>public class </em><em>Accumulator </em><em>{  </em>

<em>private static double m;   </em>

<em>private static double v;   </em>

<em>private static double st;   </em>

<em>private static  double s[]=new double[5]; </em>

<em>private static int N;</em>

<em>private static int count =0;</em>

<em>public static void main(String[] args) {</em>

<em>// TODO Auto-</em><em>generated </em><em>method stub</em>

<em>Random r = new Random();</em>

<em>System.out.println("hello world");</em>

<em>for(int i=0;i<5;i++) {</em>

<em>    double randomvalue = r.nextDouble();</em>

<em>addDataValue(randomvalue);</em>

<em>}</em>

<em>for(int i=0;i<s.length;i++) {</em>

<em>    System.out.println("dataValue:"+s[i]);</em>

<em>}   </em>

<em>mean();</em>

<em>System.out.println("mean:"+m);</em>

<em>var();</em>

<em>System.out.println("variance:"+v);</em>

<em>stddev();</em>

<em>System.out.println("standard deviation:"+st);</em>

<em>}</em>

<em>public  static void </em><em>addDataValue</em><em>(double value) {     // addes data values to array</em>

<em>  s[count]=value;</em>

<em>  count++;</em>

<em> }</em>

<em>public static double mean() {        // returns mean</em>

<em>double sum=0.0;</em>

<em>for(int i=0;i<s.length;i++) {</em>

<em>    sum+=s[i];</em>

<em>}</em>

<em>m = sum/s.length;</em>

<em> return m;</em>

<em>}   </em>

<em>public </em><em>static </em><em>double var() {    //returns variance</em>

<em>double mm = mean();</em>

<em>     double t = 0;</em>

<em>     for(int i=0;i<s.length;i++) {</em>

<em>         t+= (s[i]-mm)*(s[i]-mm);</em>

<em>} </em>

<em>     v= t/(s.length-1);</em>

<em>      return v;  </em>

<em>}</em>

<em>public static  double </em><em>stddev</em><em>() {        // returnsn the stardard deviation </em>

<em>st= Math.sqrt(var());</em>

<em>return st;</em>

<em>}</em>

<em>}</em>

See more about JAVA at brainly.com/question/12975450

#SPJ1

3 0
1 year ago
Other questions:
  • Consider the pseudo-cpu discussed in class. the instruction format is 16 bits, which is subdivided into 4-bit opcode field and 1
    14·1 answer
  • Fill in the missing statements or expressions in the following code that checks to ensure that a user enters an integer value at
    11·1 answer
  • Write a method isSorted that returns true if the list is in sorted (nondecreasing) order and returns false otherwise. An empty l
    12·1 answer
  • Your boss asks you to transmit a small file that includes sensitive personnel data to a server on the network. the server is run
    6·1 answer
  • Which of these shortcuts becomes available only when text is highlighted?
    10·1 answer
  • I don't understand how to write code for this in Java using nested for loops only. The official question is: write a program tha
    8·1 answer
  • Join my among us code<br> SHUHZF
    6·2 answers
  • Explain Text align , Text Decoration, colour, Text shadow..​
    11·1 answer
  • A sum of money is shared between 2 friends in the ratio 2 : 3. If the larger
    9·1 answer
  • i installed windows 11 all looks ok except my ebay and some other sites are all white with black text no highlights or color???
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!