4. If d is a double variable with a value of 7.5, which of the following statements results in a (1 point) value of 7 being assigned to x?
int x = (int)d;
int x = d;
int x = int(d);
double x = d;​

Answers

Answer 1

Answer:

int x = (int)d

Explanation:

(int) means the largest integer value smaller than <value>.

which is 7.

Only the first choice has the correct syntax.

The second choice sets an int as a double, which does not work.

The third one shows int as a function, d as a parameter, which is not allowed, as int is a keyword in java

For the last choice, you are setting x to 7.5 not 7.

So int x = (int)d is correct.


Related Questions

Which of these causes problems because it causes all words to have the same shape?

using left-aligned text
using all uppercase text
putting two spaces after a period
using an image instead of text

Answers

Answer:

using probably all uppercase

Explanation:

because the person will more likely think your yelling at them

but maybe even left - aligned text

PLEASE HELP THIS WAS DUE YESTERDAY AND I DIDN'T GET TO IT IN TIME!!!!!!
You must show all of your work to get full credit.
Part 1) Convert the following decimal numbers to binary.
5
89
191
25
7

Part 2) Convert the following decimal numbers to hexadecimal.
72
91
1000
57
3500

Part 3) Convert the following binary numbers to decimal.
101
11011
1001
10101
11001100

Part 4) Convert the following hexadecimal numbers to decimal.
50
200
ABC
DEF
F2A7

Part 5) Convert the following binary numbers to hexadecimal.
10101
110011
101010
1100
1001100

Part 6) Convert the following hexadecimal numbers to binary.
102
200
AB
EF
9F

Answers

Answer:

part 1 ) 5=0b101

89=0b1011001

191=0b10111111

25=0b11001

7=0b111

Part 2) 72=0X48

91=0X5b

1000=0X3e8

57=0X39

3500=0Xdac

part 3  101=5

11011=27

Explanation:

hope this helps took me a while pls make me brainliest

pleaseeeeee help me or I’m going to fail & I really want to graduate :(!!!

Answers

Answer:

Konrad Zuse

Explanation:

KONRAD ZUSE (1910-1995) 1935-1938: Konrad Zuse builds Z1, world's first program-controlled computer. Despite certain mechanical engineering problems it had all the basic ingredients of modern machines, using the binary system and today's standard separation of storage and control.

Complete the code.
import csv
inFile = open ("one.txt","r")
outFile = open("another.txt", "w")
myReader = csv.reader(inFile)
for item in myReader:
aWord = item[0]
aNumber = ___ (item[1]) + 0.4
line = aWord + "," + str(aNumber) + '\n'
outFile.write(line)

Answers

Answer:

The answer is float.

Explanation:

Which of the following computer components typically has the FASTEST performance?

RAM
NIC
Firmware/BIOS
CPU

Answers

Answer:

CPU

Explanation:

The CPU is typically the fastest component in a computer and processes a large number of commands in a short amount of time. The CPU controls the other parts of the computer by getting information from them, then telling them what to do.

Which of the following is an example of a logic error in programming?

A: Not using quotation marks and parentheses to print a string literal

B: Printing an inaccurate statement, like print("Dogs have wings.")

C: Trying to perform an impossible task, like 5 / 0

D:Using camelcase when a variable name contains two or more words

Answers

Answer:

It's C

Explanation:

Justice wrote a program and forgot to put the steps in the correct order. Which step does she need to review?

Planning
Filtering
Ordering
Sequencing

Answers

Answer: Sequencing

Explanation: I did test!

Sequencing step does she need to review.

What is Sequencing?

Sequencing is the act of placing a process's phases in order from start to finish. It is a crucial ability that is employed in math, physics, and other subject areas in addition to reading comprehension.

Look at a few sequence structures that can be used to structure instructions in a passage.

Students simply arrange a series of stages in a process or method in the proper order as part of sequencing activities. They might include topics like how to assemble equipment, set up and name a word processing file, or install an electrical switch.

Therefore, Sequencing step does she need to review.

To learn more about Sequencing, refer to the link:

https://brainly.com/question/30586864

#SPJ3

what is the main function of processing unit​

Answers

Answer:

CPU is considered as the brain of the computer. CPU performs all types of data processing operations. It stores data, intermediate results, and instructions (program). It controls the operation of all parts of the computer.

Explanation:

Answer:

CPU

Explanation:

CPU is considered as the brain of the computer. CPU performs all types of data processing operations. It stores data, intermediate results, and instructions (program). It controls the operation of all parts of the computer.

_____ (without parity) means spreading the data among multiple (at least two) drives. Group of answer choices Parity

Answers

Answer:

"Disk Striping" would be the right choice.

Explanation:

Disk stripping has become a methodology where certain numerous small external drives consist of a single massive disk. This same classification turns huge information into single blocks but instead disperses them over numerous different storage media. Disk stripping retail outlets instead of every data unit through a single place and doesn't provide disk failure safeguards.

Use the code above to write a program that when run, draws 1000 points
at random locations on a frame as it runs. For an added challenge, have
the 1000 points be in different, random colors.
Can someone actually write code for this pleaseee (IN PYTHON OR EDHESIVE)

Answers

Answer: This is what worked for me

Explanation:

The program is an illustration of frames in Python:

Frames are part of what makes up a graphic user interface program.

The missing code segment in Python, where comments are used to explain each line is as follows:

#This defines the draw handler method

def draw_handler(canvas):

   #This imports the random module  

   import random

   #This generates a random number between 0 and 1000

   randNum=random.randint(0,1000)

   #This following iteration is repeated

   for r in range (600,600):

        #This sets the rgb color code to the random number

        r = randNum; g = randNum; b = randNum

        #This gets the color code

        randRGBcolor = "RGB(" + str(r) + "," + str(b) + ")"

        #This draws the points

        canvas.draw_point([x, x],(randRGBcolor))

At the end of the program, the 1000 points are displayed on the screen

Read more about similar programs at:

https://brainly.com/question/14068778

what is a computer vhdvsidegvjks

Answers

Answer:

i'm using a computer to answer this question rn

Explanation:

vhdvsidegvjks

Which of the following components converts AC to DC?
Voltage regulator
Surge protector
Capacitor
Power supply

Answers

Answer:

Power supply

Explanation:

A computer's power supply converts alternating current (AC) from the wall outlet to direct current (DC) used by the computer's internal components.

A voltage regulator is an electronic device that supplies the appropriate voltage to a processor. It does not convert the power input from one form to another; it only ensures that the voltage remains at the appropriate level for the device. A surge protector protects a system from power spikes. A UPS (uninterruptible power supply) provides backup AC power using a reserve battery.

power supply

Explanation:

took the quiz

which guidelines should be used to make formatting tasks more efficient

Answers

“Use pasted text only; this does not keep the original formatting”
which guidelines should be used to make formatting tasks more efficient

What would be the greatest tool for emphasis? (video class)
A. Dutch angle
B. Medium Full Shot/Cowboy
C. Extreme Close Up/Insert shot
D. Medium shot

Answers

B! I'm sorry if I get this wrong :(

The computer code behind password input can be modified to force people to change their password for security reasons. This is known as “password expiration,” and some websites and companies use it regularly. However, people tend to choose new passwords that are too similar to their old ones, so this practice has not proven to be very effective (Chiasson & van Oorschot, 2015). Your friends have a hard time remembering passwords. What method can you devise for them so that they can remember their new passwords AND make them very different from the old ones?

Answers

Answer:

to remember the passwords you could either make a little rhyme to "help" remember it or you could be like everyone else and write it down on a piece of paper. you could also write the password over and over again to make it stick. a way to make a password different from an old one is to use completely different wording and completely different numbers.

Explanation:

Which function is used to remove all items from a particular dictionary?
i) len() ii) get() iii) keys() iv) None of

Answers

Answer:

The right answer is: Option 4: None of these.

Explanation:

A data structure in python is knows as a dictionary. It works like an array. Different functions can be used to perform different operations on the dictionary.

In the given options,

Option 1: len() function is used to return length of dictionary.

Option2: get() function is used with a key as argument to return the value present on the specific key

Option 3: keys() function is used to display all the keys of a dictionary in the form of a list

Hence,

The right answer is: Option 4: None of these.

7.5 Code practice Plz answer ASAP

Answers

def calculate_GPA(grade, weight):

   grades = {"A": 4, "B": 3, "C": 2, "D": 1, "F": 0}

   if weight == 0:

       return grades[grade]

   else:

       return grades[grade] + 1

classes = int(input("How many Classes are you taking? "))

total = 0

for x in range(classes):

   letter = input("Enter your Letter Grade: ")

   user_weight = int(input("Is it weighted? (1 = yes) "))

   grade = calculate_GPA(letter, user_weight)

   total += grade

   print("Your GPA score is: ", grade)

print("Your weighted GPA is a",(total/classes))

I wrote my code in python 3.8. I was able to replicate the output in your picture exactly. If you need me to make any changes, I'll do my best.

The function is an illustration of for loops

For loops are used to perform repetitive operations; just like the while loop

The program in Python, where comments are used to explain each line is as follows:

#This defines the studentGPA function

def studentGPA(grade, weight):

   #This initializes a dictionary for all grades

   allGrade = {"A": 4, "B": 3, "C": 2, "D": 1, "F": 0}

   #This sets the return grade to 0

   retValue = 0

   #If the grade is valid

   if grade in allGrade:

       #If the weight is 0

       if weight == 0:

           #Then score is not graded

           retValue = allGrade[grade]

       #If otherwise

       else:

           #This adds 1 to the return grade

           retValue = allGrade[grade]+1

   #This returns the grade point

   return retValue

#The main begins here    

#This gets the number of classes

klass = int(input("How many Classes are you taking? "))

#This initializes the total grade to 0

total = 0

#This following is repeated for each class

for x in range(klass):

   #This gets input for the letter grade

   letterGrade = input("Enter your Letter Grade: ")

   #This gets input for the weight

   weight = int(input("Is it weighted? (1 = yes) "))

   #This gets the corresponding grade

   grade = studentGPA(letterGrade, weight)

   #This prints the grade point

   print("Your GPA score is: ", grade)

   #This calculates the total grade

   total += grade

#This calculates the GPA

GPA = total/klass

#This prints the GPA

print("Your weighted GPA is a",GPA)

Read more about for loop at:

https://brainly.com/question/12736327

why CANON G1010 is the best choices than epson L3110 3in 1 Printer​

Answers

Answer:

I would say go with the canon as I have a better history with it than Epson

Explanation:

they both look similar and have similar features

The computer code behind password input can be modified to force people to change their password for security reasons. This is known as “password expiration,” and some websites and companies use it regularly. However, people tend to choose new passwords that are too similar to their old ones, so this practice has not proven to be very effective (Chiasson & van Oorschot, 2015). Your friends have a hard time remembering passwords. What method can you devise for them so that they can remember their new passwords AND make them very different from the old ones?

Answers

Answer:

to remember the passwords you could either make a little rhyme to "help" remember it or you could be like everyone else and write it down on a piece of paper. you could also write the password over and over again to make it stick. a way to make a password different from an old one is to use completely different wording and completely different numbers.

Explanation:

Answer:

B

Explanation:

got it right

A career in culinary arts can best be described as working in the __________ industry.
A.
food
B.
clothing
C.
computer
D.
entertainment

Answers

Answer:

A-Food

Explanation:

The answer would be A:Food

Peer collaboration helps develop critical-thinking skills, which is the ability to

focus on multiple subjects at once.
criticize the thoughts of others.
examine a subject more closely.
focus on a single opinion or perspective.

Answers

Answer:

its c

Explanation:

after a few googel searches this is the answer

Answer:examine a subject more closely.

Explanation:

i just finshed the test

what are the peripherals of a computer ​

Answers

Answer:

A computer peripheral is any external device that provides input and output for the computer.

I REALLY Need help on this.

Answers

Make a deposit talk to A representative transfer money and Check account balance

how many string object are in 128,55 in python

Answers

Answer:

Explanation:

In the following examples, input and output are distinguished by the presence or absence of prompts (>>> and …): to repeat the example, you must type everything after the prompt, when the prompt appears; lines that do not begin with a prompt are output from the interpreter. Note that a secondary prompt on a line by itself in an example means you must type a blank line; this is used to end a multi-line command.

Many of the examples in this manual, even those entered at the interactive prompt, include comments. Comments in Python start with the hash character, #, and extend to the end of the physical line. A comment may appear at the start of a line or following whitespace or code, but not within a string literal. A hash character within a string literal is just a hash character. Since comments are to clarify code and are not interpreted by Python, they may be omitted when typing in examples.

There are 4 strings within the best_list. Strings can be easily identified becuase they're surrounded with quotes. For example, "hello" is a string because it has the quotes around it.

Irene wants to connect her smartphone wirelessly to her laptop in order to transfer images. Which two technologies could she reasonably employ to connect these devices?

Wi-Fi
infrared
satellite
mobile network
Bluetooth

Answers

Answer:

The correct answers are

Wifi

Bluetooth

Explanation:

I got it right on the Edmentum test.

Irene wants to connect her smartphone wirelessly to her laptop in order to transfer images two technologies could she reasonably employ to connect these devices are Wi-Fi and Bluetooth.

What is the wireless network?

As an example, it's far usually hired in headsets for cell phones, allowing hands-unfastened cell smartphone use. Wi-Fi, on the alternative hand, lets in gadgets hook up to the Internet. Bluetooth limits the range of gadgets that can join at someone's time, while Wi-Fi is open to greater gadgets and greater users.

Wi-Fi is possibly the largest and maximum tricky example, as are different Bluetooth receivers and gadgets, that can intrude on one another. The backside line is this: WiFi is the wi-fi community you operate to your house, however it is able to be made out of any form of network connection.

Read more about the mobile network:

https://brainly.com/question/917245

#SPJ2

Question 7 of 10
What is an End User License Agreement (EULA) an example of?
A. Integer license
B. Open source license
C. Proprietary liger
lisense
C
D. Numeric license

Answers

Answer:The answer is Proprietary license

Explanation:

An example of the end-user license agreement is the proprietary liger. Thus, the correct option is C.

What is an end-user license agreement?

An end-user license agreement (EULA) is a legal contract between a software supplier and a customer or the end-user. It is generally made available to the customers or the end-user via a retailer which is acting as an intermediary in this agreement.

An end-user license agreement specifies in detail all the rights and restrictions which is applied to the use of the software program. Ignoring the EULAs can expose the computer to security risks. Ignoring EULAs can put the privacy of the system at risk.

An example of the end-user license agreement is the proprietary liger.

Therefore, the correct option is C.

Learn more about End-user license agreement here:

https://brainly.com/question/14681311

#SPJ2

Danny wants to create a web page for her friends dog walking service. Which coding language should she use

Answers

Answer:

html js css

Explanation:

Do the lengths of 10,4 and 5 form a triangle explain why please I’m confused

Answers

Answer:

no

Explanation:

Imagine having sticks of these lengths. Attach the 4 and 5 to both ends of the 10. No way you can have them touch each other, not even when the triangle is flat.

The 4 and 5 add up to 9, that is less than 10.

The Triangle Inequality Theorem states that the sum of any 2 sides of a triangle must be greater than the measure of the third side.

create a flowchart to print numbers from 1 to 100
( IF U ANSWER PROPERLY I WILL MARK U AS BRAINLIEST)

Answers

Answer:

brainliest plsss

Explanation:

I think so this is what you had asked!!!!!!

hope it helps

who is big brain me or you

Answers

Question:

Who is big brain me or you?

Answer:

I think is you because your the best I can be with you and I hope it helps

#CARRYONLEARNING #STUDYWELL
Other Questions
The Twelve Tables were _____.a series of formulasa dining hall for diplomatsa code of law To catch a ball, a professional baseball player leaps into the air with an initial velocity of14 feet per second. Write a model for the height of the player above the ground after t seconds. After how many seconds does the player land on the ground? What would be the domain of this function? Determine whether a triangle with the given side lengths is a right triangle. Side lengths: 10, 11, 15 5, 12, 13 12, 15, 20 16, 30, 34 write a expression that represents the height of a tree that begins at 8 feet and increases by 2 feet per year. Let t represent the number of years. How tall will the tree be in 5 years? fionas laptop computer weighs 2.5 kilograms. What is the weight of the computer in grams? What is the pow of a4.5 x 10-3 M OH solution? Which type of wave forms at the boundary between air and water when youdrop a rock into a pond?A. ElectromagneticB. SurfaceC. LongitudinalD. Transverse How do I put this into a sentence the steam floods during rainstorms . The stream is muddy . The steam floods easily. Identify the interval(s) on which the function y = 2x^2 - 8x - 10 is positive.A. -1B. x < -1 and x > 5C. -5D. X 1 comme passe-temps ?19. Qu'est-ce que tu aimesa) faisb) fairec) fait The number -44 is between which 2 integers. The graph shows the cost C in dollars of w pounds of blueberries, a proportional relationship.Select all the true statements. (HINT...THERE IS MORE THAN ONE ANSWER)Group of answer choices1 pound of blueberries costs $2.75.2.75 pounds of blueberries cost $1.5 pounds of blueberries cost $15.50.12 pounds of blueberries cost $33.The point (3, 9) is on the graph of the proportional relationship. Which chemical bond most likely stores the most energy? A. C=CB. C-C C. H-HD. H-O Iron-containing minerals in rocks may combine with water and air to create rust. This is an example of A. chemical weatheringB. mechanical weatheringC. abrasionD. exfoliation True or False: A neuron's response is all-or-nothing. help me plz its about algebra 1 if cube has total surface area 150cm sweet, find the volume of the cube yoo i need help... pls PREDICT Pangolins share many characteristics with different typesof animals. How do scientists determine the evolutionaryrelationships between different organisms? Brisbane is 10 hours ahead of London and New York is 5 hours behind London. Arsh lives in Brisbane. At 12 noon on 5 November, Arsh calls Lily who lives in New York, what time and date is it in New York?