Answer:
Gigabyte: Unit of measurement, is 10^9 bytes.
Intranet: Network that is used for sharing info, and other services.
Pixel: Creates a image, it is the smallest element on a display on a device.
Modem: Converts signals produced by a computer or another type of device.
Digital: Problem solving by any capable class device.
Explanation:
Short and simple.
Answer:
Java code is given below
Explanation:
import java.util.Random;
class Die{
private int sides;
public Die(){
sides = 6;
}
public Die(int s){
sides = s;
}
public int Roll(){
Random r = new Random();
return r.nextInt(6)+1;
}
}
class DieRoll{
public static void main(String[] args) {
Die die = new Die();
int arr[] = new int[6];
for(int i=0; i<6; i++)
arr[i] = 0;
for(int i=0; i<100; i++){
int r = die.Roll();
arr[r-1]++;
}
for(int i=0; i<6; i++)
System.out.println((i+1)+" was rolled "+arr[i]+" times.");
}
}
Answer:
Check the explanation
Explanation:
Here in this game of Tic-Tac-Toe, it is using the TPGE engine which is a Tiny Python Game Engine. Let's talk about its functions like:-
def image_type(img): In this function, it is simply taking image as a parameter and returning its object type like DISC if the image is in graphical form, TEXT if it is a string, and LINE if it is other than the mentioned object.
def convert_image(img): In this function, it is simply taking image as a parameter and returning an equivalent graphical object as understood by John Zelle's. Mainly comparing for three things in this function and those are: if image equals to DISC then it is calling convert_circle(function), if image equals to LINE then it is calling convert_line(function), and if image equals to TEXT then it is calling convert_text(function),
def convert_circle(x): This function takes a list( a group of values) and makes a circle at the center of the window and the circle's radius is coming from the list.
convert_text, convert_line, convert_circle are only creating text, line, and circle and then returning it.
def graphical_elements(images): This function is taking image as a parameter and then extracting shape and color from the image and then calling convert_image(shape) and convert_type(shape) and it gives us graphic and kind respectively. Now it is checking whether kind equals to DISC If yes then filling color on the window else, setting the outline of the window
def run(): Here it is finally running the game with required parameters, the whole game is continously running under the while loop.
That's all
Answer:
#include <iostream>
using namespace std;
double DrivingCost(int drivenMiles,double milesPerGallon,double dollarsPerGallon)
{
double dollarsperMile=dollarsPerGallon/milesPerGallon;//calculating dollarsperMile.
return dollarsperMile*drivenMiles;//returning thr driving cost..
}
int main() {
double ans;
int miles;
cout<<"Enter miles"<<endl;
cin>>miles;
ans=DrivingCost(miles,20.0,3.1599);
cout<<ans<<endl;
return 0;
}
Output:-
Enter miles
10
1.57995
Enter miles
50
7.89975
Enter miles
100
15.7995
Explanation:
In the function first I have calculated the dollars per mile and after that I have returned the product of dollarspermile and driven miles.This will give the cost of the Driving.
It’s C. An MP3 file is an audio/video file, so only a media player would be able to play this