Answer:
The value of "x" is stored at "main memory".
Explanation:
Simply Central processing unit, input device and output device can not store the data.
Answer:
Following is the program in c++ language
#include <iostream> // header file
using namespace std; // namespace
int maxSum(int ar[][10],int r) // function definition of maxsum
{
int s=0; // varaible declaration
for(int k=0;k<r;k++)// iterating the loop
{
int maximum=ar[k][0]; //finding the maximum value
for(int k2=0;k2<10;k2++)// iterating the loop
{
if(maximum<ar[k][k2]) // check the condition
{
maximum=ar[k][k2]; // storing the value in the maximum variable
}
}
s=s+maximum;//adding maximum value to the sum
}
return s; // return the sum
}
int main() // main function
{
int ar[][10]={{5,2,8,-8,9,9,8,-5,-1,-5},{4,1,8,0,10,7,6,1,8,-5}}; // initilaized array
cout<<"sum of maximum value:";
int t=maxSum(ar,2); // function calling
cout<<t; // display the maximum value
}
Output:
sum of maximum value:19
Explanation:
Following are the description of Program
Answer:
Explanation:
import java.util.Array;
public class Items{
public static void main (String {} args){
// a. Set up 4 arrays which hold data about 6 items you want to sell
int [] itemnum = new int[](1,2,3,4,5,6);
int [] quantity = new int[](500,200,350,100,270,300);
double [] price = new double [](10000, 50000,30000, 22000, 26000,100200);
double[] sales = new double [6];
//b. Set up loops to load the itemnum, quantity and price arrays
for(int I=0;I<6;I++)
{
System.out.println("Item "+itemnum[I]);
System.out.println("Item "+quantity[I]);
System.out.println("Item "+price[I]);
}
//c. Set up another loop to calculate values for the sales array.
for(int j=0;j<6;j++)
{
sales[j] = quantity[j] * price[j];
}
//d. Set up another loop to print the item number and sales amount for each transaction
for(int k=0;k<6;k++)
{
System.out.println("Item Number "+itemnum[k]);
System.out.println("Sales Amount "sales[k]);
}
//e. Set up another loop to calculate the total sales of all 6 items
double totalsales = 0;
for(int l=0;l<6;l++)
{
totalsales+=sales[l];
}
//f. print the total sales amount
System.out.print("Total Sales: "+totalsales);
}
}
The statement which gives the sum of nickel and dime is written below :
total_coins = nickel_count + dime_count
The statement required is written using Python 3 :
deftotal(nickel_count, dime_count) :
total_coins =dime_count+nickel_count
print(total_coins)
total(100, 200)
#the function total takes in two arguments(number of nickels and number of dimes)
#assigns the varibale total_coins to the sum of nickel_count and dime_count
nickel_count = int(input('Enter count of nickel : '))
# User is prompted to enter number of nickels
dime_count = int(input('Enter count of dime : '))
# User is prompted to enter number of dimes
total_coins = nickel_count + dime_count
#assigns the varibale total_coins to the sum of nickel_count and dime_count
print(total_coins)
#outputs the value of total_coins
Learn more : brainly.com/question/17615351
Answer:
total_coins = nickel_count + dime_count
Explanation:
The statement that performs the operation in the question is total_coins = nickel_count + dime_count
Full Program (Written in Python)
nickel_count = int(input("Nickel Count: "))
dime_count = int(input("Dime Count: "))
total_coins = nickel_count + dime_count
print("Total coins: ",total_coins)
The first two lines prompt user for nickel and dime count respectively
The third line adds the two coins categories together
The last line prints the total count of coins
example to help you. The algorithm that you will write should be in everyday language
(no pseudocode or programming language). Write your instructions at the bottom of the
page.
Example: 1. Move
the orange box 2
spaces to the right.
2. Move the green
box one space
down. 3. Move the
green box two
spaces to the left.
Write your instructions. Review the rubric to check your final work.
Rules: All 6 colors (red, green, yellow, pink, blue, purple) must be move to their new location on the grid. Block spaces are
barriers. You cannot move through them or on them – you must move around them
Answer:
Explanation:
Pink: Down 5 then left 2.
Yellow: Left 3 and down 2.
Green: Right 7, down 4 and left 1.
Purple: Up 6 and left 9.
Red: Left 7, down 5 and left 1.
You can do the last one, blue :)
Answer:
Explanation:
u=up, d=down, r=right, l=left
yellow: l3d2
pink: d5l2
green: r7d4l1
purple: u6l9
red: l7d5l1
blue: r2u7l5
Answer:
Given Data:
Clock rate of P1 = 4 GHz
Clock rate of P2 = 3 GHz
Average CPI of P1 = 0.9
Number of Instructions = 5.0E9 = 5 × 10^9
Clock rate of P2 = 3 GHz
Average CPI of P2 = 0.75
Number of Instructions = 1.0E9 = 10^9
To find: If the computer with largest clock rate has the largest performance?
Explanation:
Solution:
As given in the question, clock rate of P1 = 4 GHz which is greater than clock rate of P2 = 3 GHz
According to the performance equation:
CPU Time = instruction count * average cycles per instruction/ clock rate
CPU Time = I * CPI / clock rate
Where instruction count refers to the number of instructions.
Performance of P1:
CPU Time (P1) = 5 * 10^9 * 0.9 / (4 * 10^9)
= 5000000000 * 0.9 / 4000000000
= 4500000000 / 4000000000
= 1.125s
Performance of P2:
CPU Time (P2) = 10^9 * 0.75/ (3 * 10^9)
= 750000000 / 3000000000
= 0.25s
So the Performance of P2 is larger than that of P1,
performance (P2) > performance (P1)
0.25 is better than 1.125
But clock rate of P1 was larger than P2
clock rate of P1 > clock rate of P2
4 GHz > 3 GHz
So this is a misconception about P1 and P2.
It is not true that computer with the largest clock rate as having the largest performance.