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
GalinKa [24]
3 years ago
13

Suppose that a machine with a 5-stage pipeline uses branch prediction. 15% of the instructions for a given test program are bran

ches, of which 84% are correctly predicted. The other 16% of the branches su er a 4-cycle mis-prediction penalty. (In other words, when the branch predictor predicts incorrectly, there are four instructions in the pipeline that must be discarded.) Assuming there are no other stalls, develop a formula for the number of cycles it will take to complete n lines of this program

Computers and Technology
1 answer:
zhenek [66]3 years ago
3 0

Answer:

solution attached below

Explanation:

You might be interested in
Write a program to find all integer solutions to the equation 4x + 3y -9z = 5 for values of x, y, and z between 0 to 100.
rjkz [21]

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

  int c= 0;//defining integer variable to count number of solutions

  int x,y,z;//defining integer variable which is used in the loop

  for (x = 0; x <= 100; x++)//defining for loop to x value

     for (y = 0; y <= 100; y++)//defining for loop to y value

        for (z = 0; z <= 100; z++)//defining for loop to z value

           if (4 * x + 3 * y - 9 * z == 5)//use if to check given condition

           {

              c++;//increment count value

              cout << "(" << x << "," << y << "," << z << ")";//print solutions  

              cout << (c % 11? " " : "\n");//use for add file solution in a row

           }

  cout << "\n\nThere are " << c << " solution(s)\n";//print solution couts

  return 0;

}

Output:

Please find the attached file.

Explanation:

In the above-given code four integer variable "x,y,z, and c" is declared, in which "x,y, and z" is used in the for loop with the if conditional statement that checks the given condition and prints the solution and the "c" variable is used to counts the number of solution, and at the last, it uses the print method to print its values.  

8 0
3 years ago
Write IF() function for student 3, If total mark is greater than 10 then print
Debora [2.8K]

Answer:

Explanation:

The following code is written in Java. The if() function is actually called an if statement. The following code can be copied and pasted where you need as long as it is within the scope of the mark variable in order to call it and compare it to 10

if (mark > 10){

           System.out.println("you have scored good");  

       } else {

           System.out.println("you need to improve ");

       }

3 0
3 years ago
In this lab, you will build a system for package delivery services that provides different shipping options with specific price.
Alex73 [517]

Answer:

See explaination

Explanation:

#include <iostream>

#include <string.h>

using namespace st d;

class Package

{

protected:

//sender properities

char sname[10],saddress[50],scity[20],sstate[20];

long int szip;

//Receiver properities

char rname[10],raddress[50],rcity[20],rstate[20];

long int rzip;

//additonal datamembers

float weight,cost;

public:

Package() //Default constructor

{

strcpy(sname,"");strcpy(saddress,"");strcpy(scity,"");

strcpy(sstate,"");szip=0;

strcpy(rname,"");strcpy(raddress,"");strcpy(rcity,"");

strcpy(rstate,"");rzip=0;

weight=cost=0;

}

Package(char sn[10],char sa[50],char sc[20],char ss[20],long int sz,char rn[10],char ra[50],char rc[20],char rs[20],long int rz,float w,float c) //Constructor with parameter

{

strcpy(sname,sn);strcpy(saddress,sa);strcpy(scity,sc); //copying each parameter value to data member

strcpy(sstate,ss);szip=0;

strcpy(rname,rn);strcpy(raddress,ra);strcpy(rcity,rc);

strcpy(rstate,rs);rzip=0;

weight=w;cost=c;

}

float calculateCost() //calculating cost

{

return weight*cost;

}

};

class TwoDayPackage:public Package //Inheritance

{

float flatfee;

public:

TwoDayPackage(char sn[10],char sa[50],char sc[20],char ss[20],long int sz,char rn[10],char ra[50],char rc[20],char rs[20],long int rz,float w,float c,float ff) //Constructor with parameter

{

Package(sn,sa,sc,ss,sz,rn,ra,rc,rs,rz,w,c); //calling super class constructor

flatfee=ff; //copy last parameter

}

float calculateCost() //redefined calculateCost function

{

return (weight*cost)+flatfee; //return total cost

}

};

class OverNightPackage:public Package //Inheritance

{

float addfee;

public:

OverNightPackage(char sn[10],char sa[50],char sc[20],char ss[20],long int sz,char rn[10],char ra[50],char rc[20],char rs[20],long int rz,float w,float c,float a f) //constructor with parameter

{

Package(sn,sa,sc,ss,sz,rn,ra,rc,rs,rz,w,c); //calling super class constructor

addfee=a f; //copy last parameter

}

float calculateCost() //redefined calculateCost function

{

return (weight*cost)+addfee; //calculating total cost

}

};

int main()

{

Package package1("lou brown","1 main st","boston","ma",11111,"mary smith","7 elm st","new york","ny",22222,8.5,0.5); //creating objects

TwoDayPackage package2("lisa klein", "5 broadway", "somerville", "ma", 33333, "bob george", "21 pine rd", "cambridge", "ma", 44444, 10.5, .65, 2.0 );

OverNightPackage package3 ("ed lewis", "2 oak st", "boston", "ma", 55555, "don kelly", "9 main st", "denver", "co", 66666, 12.25, .7, .25 );

cout<<"\nPackage Cost : "<<package1.calculateCost(); //calling each cost

cout<<"\nTwoDay Package Cost : "<<package2.calculateCost();

cout<<"\nOvernight Package Cost : "<<package3.calculateCost();

return 0;

}

8 0
3 years ago
What is a data broker?
AleksAgata [21]

Answer:

The correct option is a.

A business that collects personal information about consumers and sells that information to other organizations.

Explanation:

Data brokers, also known as data suppliers, data fetchers, information brokers, or even data providers are businesses or companies (even individuals) that, on the most basic level, source and aggregate data and information (mostly information that are meant to be confidential or that are in the real sense difficult to get) and then resell them to third parties. These third parties could be other data brokers.  

They collect data and information from a wide range of resources and sources - offline and/or online e.g web access history, bank details, credit card information, official records (such as birth and marriage certificates, driver's licenses).  

Brokers can steal round about any information. Examples of information that brokers legally or illegally steal are full name, residential address, marital status, age, gender, national identification number, bank verification number. Brokers and hackers are siblings.

A couple types of data brokers are:

1. Those for fraud detection

2. Those for risk mitigation  

Hope this helps!

6 0
3 years ago
Consider the following class:
Pachacha [2.7K]

Answer:

c.return Integer.compare(value, otherTemp.value)

Explanation:

The compare() method as the name implies compares two integer values. If they are equal it returns 0, if the first number is smaller it returns -1, and if the first number is greater it returns 1.

It is an Integer class method that is why you need to type Integer.compare() to call the function.

For this example, the parameters that will be compared are <em>value</em>, and <em>otherTemp.value. </em>The type of compareTo method is an integer, we need to return the result.

3 0
2 years ago
Other questions:
  • 1- Design a brute-force algorithm for solving the problem below (provide pseudocode): You have a large container with storage si
    10·1 answer
  • If you want to copy text formatting from one area of your document to another area, _____.
    5·2 answers
  • You have a site (Site1) that has about 20 users. For the last few months, users at Site1 have been complaining about the perform
    9·1 answer
  • Where is a 3D modeler most likely to work?
    6·1 answer
  • Advantages and disadvantages of technology
    13·1 answer
  • A(n) is the tool that will help you the most when developing the content you will use in your presentation.
    10·1 answer
  • Partes de la ventana principal de Microsoft excel 2013 con sus respectivas funciones
    14·1 answer
  • Ryan would like to copy a list of contacts from a colleague into his personal address book. The list of contacts is
    9·1 answer
  • I'm having trouble with an assignment of mine. I'm making a text based adventure game for extra credit in my class and I'm stuck
    12·1 answer
  • With _____ technology, a web server delivers information to users, who have signed up for the service, instead of waiting for th
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!