Answer:
smarter than humans. but feel less than humans
12. Write C statement(s) that accomplish the following. a. Declare int variables x and y. Initialize x to 25 and y to 18. b. Declare and initialize an int variable temp to 10 and a char variable ch to 'A'. c. Update the value of an int variable x by adding 5 to it. d. Declare and initialize a double variable payRate to 12.50. e. Copy the value of an int variable firstNum into an int variable tempNum. f. Swap the contents of the int variables x and y. (Declare additional variables, if necessary.) g. Suppose x and y are double variables. Output the contents of x, y, and the expression x 12 / y - 18. h. Declare a char variable grade and set the value of grade to 'A'. i. Declare int variables to store four integers. j. Copy the value of a double variable z to the nearest integer into an int variable x.
Answer:
a.
int x = 25;
int y = 18;
b.
int temp = 10;
char ch ='a';
c.
x += 5;
d.
double payRate = 12.5;
e.
int tempNum = firstNum;
f.
int tempp = x;
x = y;
y = tempp;
g.
printf("Value of x = %f\n",x);
printf("Value of y = %f\n",y);
printf("Arithmetic = %f\n",(x + 12/y -18));
h.
char grade = 'A';
i.
int a,b,c,d;
a = 5; b = 2; c = 3; d = 6;
j.
int x = round(z);
Explanation:
The answers are straight forward.
However, I'll give a general hint in answering questions like this.
In C, variable declaration is done by:
data-type variable-name;
To declare and initialise the variable, you do;
data-type variable-name = value;
So, for questions that requires that we declare and initialise a variable, we make use of the above syntax..
Take (a) for instance:
int x = 25;
int y = 18;
Same syntax can be applied to (b), (d), (e), (h) & (I)
For question (c);
This can be done in two ways;
x = x + 5;
Or
x+=5;
Both will give the same result.
For question (f):
We start by initialise a temporary variable that stores x.
Then we store the value of x in y.
Then we store the content of the temporary variable to y.
This swaps the values of x and y
For question (g):
When printing a double variable in C, we make use of '\f' as a string format
For question (j):
The round function is used to round up a double variable to integer.
How do I write this in binary number ?
1/3 ~ 100001.010101...
an exact value cannot be found; therefore, the zeros in ones in this binary representation of 1/3 alternate forever.
Research the disadvantages of the computer and explain them.
Answer:
Too much sitting-affects the back and makes our muscles tight
Carpal tunnel and eye strain-moving your hand from your keyboard to a mouse and typing are all repetitive and can cause injuries
Short attention span and too much multitasking-As you use a computer and the Internet and get immediate answers to your questions and requests, you become accustomed to getting that quick dopamine fix. You can become easily frustrated when something doesn't work or is not answered in a timely matter.
What is the value of the variable result after these lines of code are executed?
>>> a = 10
>>> b = 2
>>> c = 5
>>> result = a * b - a / c
The value of the variable is
.
Answer:
18
Explanation:
If you take the formula, and you substitute the values of the variables, it will be:
10 * 2 - 10 / 5
Then if you remember the order of math operations, it will be:
(10 * 2) - (10 / 5)
Which reduces to:
20 - 2 = 18
The value of the variable result is 18
The code is represented as follows:
Python code:a = 10
b = 2
c = 5
result = a * b - a / c
Code explanation;The variable a is initialise to 10The variable b is initialise to 2Lastly, the variable c is initialise to 5Then the arithmetic operation variable a multiplied by variable b minus variable a divided by variable c is stored in the variable "result".
Printing the variable "result" will give you 18.
Check the picture to see the result after running the code.
learn more on coding here: https://brainly.com/question/9238988?referrer=searchResults
Write a method that will receive 2 numbers as parameters and will return a string containing the pattern based on those two numbers. Take into consideration that the numbers may not be in the right order.
Note that the method will not print the pattern but return the string containing it instead. The main method (already coded) will be printing the string returned by the method.
Remember that you can declare an empty string variable and concatenate everything you want to it.
As an example, if the user inputs "2 5"
The output should be:
2
3 3
4 4 4
5 5 5 5
Answer:
The purpose of the Java compiler is to translate source code into instructions public static void main(String[] args) Arity is the number of arguments passed to a constructor or method or the number ... and objects, which are the focus of object-based programs. Remove the 2 from between the square brackets to make.
Explanation:
This program will calculate the rise in ocean levels over 5, 10, and 50 years, Part of the program has been written for you. The part that has been written will read in a rise in ocean levels (per year) in millimeters. This value is read into a variable of type double named risingLevel. You will be completing the program as follows Output the value in risingLevel. This should be the first line of output. The output should be as follows (assume risingLevel has a value of 2.1) Level: 2.1 The number of millimeters higher than the current level that the ocean's level will be in 5 years (assuming the ocean is rising at the rate of risingLevel per year). This is your second line of output. The output will be as follows Years: 5, Rise: 10.5 The number of millimeters higher than the current level that the ocean's level will be in 10 years (assuming the ocean is rising at the rate of risingLevel per year). This is your third line of output. The output will be as follows (for a risingLevel" of 2.1 Years: 10, Rise: 21 The number of millimeters higher than the current level that the ocean's level will be in 50 years (assuming the ocean is rising at the rate of risingLevel per year). This is your final line of output.The output will be as follows (for a risingLevel" of 2.1) Years: 50, Rise: 105 For each of the above you need to output the number of years and the total rise in ocean levels for those years. This is all based on the value in risingLevel For example: ArisingLevel of 2.1 for 5 years would have the following output: Level: 2.1 Years: 5, Rise: 10.5 Years: Years: 50, Rise: 105 10, Rise: 21 Your output must have the same syntax and spacing as above
Answer:
Here is the C++ program:
#include <iostream> //to use input output functions
using namespace std; //to identify objects cin cout
int main(){ //start of main method
double risingLevel; //declares a double type variable to hold rising level
cin>>risingLevel; //reads the value of risingLevel from user
cout<<"Level: "<<risingLevel<<endl; //displays the rising level
cout << "Years: 5, Rise: " << risingLevel * 5<<endl; //displays the rise in ocean level over 5 years
cout << "Years: 10, Rise: " << risingLevel * 10<<endl; //displays the rise in ocean level over 10 years
cout << "Years: 50, Rise: " << risingLevel * 50<<endl; //displays the rise in ocean level over 50 years
}
Explanation:
The program works as follows:
Lets say the user enters rising level 2.1 then,
risingLevel = 2.1
Now the first print (cout) statement :
cout<<"Level: "<<risingLevel<<endl; prints the value of risingLevel on output screen. So this statement displays:
Level: 2.1
Next, the program control moves to the statement:
cout << "Years: 5, Rise: " << risingLevel * 5<<endl;
which computes the rise in ocean levels over 5 years by formula:
risingLevel * 5 = 2.1 * 5 = 10.5
It then displays the computed value on output screen. So this statement displays:
Years: 5, Rise: 10.5 Next, the program control moves to the statement:
cout << "Years: 10, Rise: " << risingLevel * 10<<endl;
which computes the rise in ocean levels over 10 years by formula:
risingLevel * 10 = 2.1 * 10 = 21
It then displays the computed value on output screen. So this statement displays:
Years: 10, Rise: 21
Next, the program control moves to the statement:
cout << "Years: 50, Rise: " << risingLevel * 50<<endl;
which computes the rise in ocean levels over 50 years by formula:
risingLevel * 50 = 2.1 * 50 = 105
It then displays the computed value on output screen. So this statement displays:
Years: 50, Rise: 105 Hence the output of the entire program is:
Level: 2.1 Years: 5, Rise: 10.5 Years: 10, Rise: 21 Years: 50, Rise: 105
The screenshot of the program and its output is attached.
Sukhi needs to insert a container into her form to collect a particular type of information. Which object should she insert?
text box
form field
field code
image
Answer:
text box
Explanation:
When it comes to collecting information such as the user's name, telephone number, address, etc., it is important to insert a text box into the form field. This can be done in several ways, such as giving the user the freedom to type her own response in the text box or making it "pre-filled." A text box with pre-filled value means that the user cannot type anything in the box because it has an existing value (default value). The text box may also give a "hint" in order to let the user know of possible values he can choose.
Answer:
A- text box
Explanation: ;)
If you cut a piece of text but intended to copy it, what command can you use to correct your error?
Format painter
Paste
Redo
Undo
Answer:
It should be undo, as the deleted text is pasted. You can then, copy it.
Answer:
undo
Explanation:
you can undo the cutting and copy instead
Complete the sentence. the binary number represented by the voltage graph below is
11010100=43
is applied by 8-bit
The binary number represented by the voltage graph below is 00110110.
A bit (i.e., a 'binary digit'), refers to the smallest unit of data of a computer, which only can take two different values: either zero (0) or one (1).In general, voltages around five Volts (5 V) represent 1, whereas voltages around zero (0 V) represent 0. Voltage signals used to indicate either zero (0) or one (1) are referred to as bits.In conclusion, the binary number represented by the voltage graph below is 00110110.
Learn more in:
https://brainly.com/question/9480337
Create a class named Tile that represents Scrabble tiles. The instance variables should include a String named letter and an integer named value. Write a constructor that takes parameters named letter and value and initializes the instance variables. Write a method named printTile that takes a Tile object as a parameter and displays the instance variables (letter and value) in a reader-friendly format. Using a Driver class create a Tile object with the letter Z and the value 10, and then uses printTile to display the state of the object. Create getters and setters for each of the attributes.
Answer:
Here is the Tile class:
class Tile { //class name
// declare private data members of Tile class
private int value; //int type variable to hold the integer
private String letter; //String type variable to hold the letter
public void setValue(int value){ //mutator method to set the integer value
this.value = value; }
public void setLetter(String letter){ //mutator method to set the letter
this.letter = letter; }
public int getValue() //accessor method to access or get the value
{return value;} //returns the current integer value
public String getLetter() //accessor method to access or get the letter
{return letter;} //returns the current string value
public Tile(String letter, int value){ //constructor that takes parameters named letter and value
setValue(value); //uses setValue method to set the value of value field
setLetter(letter); } } //uses setValue method to set the value of letter field
/* you can also use the following two statements inside constructor to initializes the variables:
this.letter = letter;
this.value = value; */
Explanation:
Here is the driver class named Main:
public class Main{ //class name
public static void main(String[] args) { //start of main method
Tile tile = new Tile("Z", 10); //creates object of Tile class named tile and calls Tile constructor to initialize the instance variables
printTile(tile); } //calls printTile method by passing Tile object as a parameter
public static void printTile(Tile tile) { //method to displays the instance variables (letter and value) in a reader-friendly format
System.out.println("The tile " + tile.getLetter() + " has the score of " + tile.getValue()); } } //displays the string letter and integer value using getLetter() method to get the letter and getValue method to get the value
The screenshot of the output is attached.
his exercise creates a program to convert the temperature values form Fahrenheit to Celsius for a list of 10 temperature values between -10° and 75°. The program shall have the following features:1. Create a temperature list that contains 10 values ranging from -10° to 75°.2. Create a function to convert temperature values from Fahrenheit to Celsius.3. Create a while-loop to index the temperature value item in the list and call the function to calculate the temperature value in Celsius.4. Print the temperatures in the format of:32 degrees Fahrenheit = 0 degrees Celsius
Answer:
def fahrenheit_to_celsius(temperature):
c = (temperature - 32) / 1.8
return c
temperature_list = [-10, -5, 0, 10, 20, 32, 40, 50, 60, 75.2]
i = 0
while i < 10:
print(str(temperature_list[i]) + " degrees Fahrenheit = " + str(fahrenheit_to_celsius(temperature_list[i])) + " degrees Celsius")
i += 1
Explanation:
*The code is in Python.
Create a function named fahrenheit_to_celsius that takes one parameter, temperature
Convert the temperature to celsius using the formula
Return the result of the conversion
Create a list holding ten temperatures
Create a while loop that iterates 10 times. Inside the loop, call the function to convert the each temperature in the list and print the result
Steven wrote an algorithm for his coding class that explains how he makes a cake. Which is the correct sequence of steps that he used?
Mix the ingredients, put into the oven, preheat the oven
Preheat the oven, mix the ingredients, put into oven
Preheat the oven, put into the oven, mix the ingredients
Put into the oven, mix the ingredients, preheat the oven
WILL GIVE ALOT OF POINTS "29" TOTAL
Answer:
Preheat the oven, mix the ingredients, put into oven.
Answer:
Preheat oven, mix the ingredients, put into oven
Explanation:
basically its B
:)
5.24 LAB: Two smallest numbers Write a program that reads a list of integers, and outputs the two smallest integers in the list, in ascending order. The input begins with an integer indicating the number of integers that follow. You can assume that the list will have at least 2 integers and less than 20 integers. Ex: If the input is: 5 10 5 3 21 2 the output is: 2 3 To achieve the above, first read the integers into an array. Hint: Make sure to initialize the second smallest and smallest integers properly. 265236.1527390
Answer:
Here is the C++ program:
#include <iostream> //to use input output function
#include <vector> //to use vectors
using namespace std; //to identify objects like cin cout
int main() { //start of main method
int size, number; //to store size of list and input numbers
cout<<"Enter list size: "; //prompts user to enter size of the list
cin >> size; //reads list size from user
vector<int> v; //creates a vector named v
for (int i = 0; i < size; ++i) { //iterates till the size of list reaches
cin >> number; //reads the input numbers
v.push_back(number); } //push number into a vector from the back
int num1 = v[0], num2 = v[1], current , temp; //num1 is set to the element at 0-th position of v and num2 is set to be on 1st index of v
if (num1 > num2) { //if num1 is is greater than num2
temp = num1; //assigns value of num1 to temp
num1 = num2; //assigns value of num2 to num1
num2 = temp; } //assigns value of temp to num2
for (int i = 2; i < size; ++i) { //iterates size times
current = v[i]; //set current to the i-th index of v
if (current < num1) { //if current is less than num1
num2 = num1; //assigns value of num1 to num2
num1 = current; } //assigns value of current to num1
else if(current < num2) { //if value of current is less than num2
num2 = current; } } //assigns value of current to num2
cout<<num1<< " "<<num2<< endl; } //dispalys num1 and num2 i.e. two smallest integers in ascending order
Explanation:
I will explain the program with an example.
Lets say the list size is 4 and numbers are 1 2 3 4
for (int i = 0; i < size; ++i)
This loop reads each number (1,2,3,4) and adds that number to the vector v which is the sequence container. The method push_back is used which inserts each number into the vector at the end, after the current last number and the vector size is increased by 1.
Next num1 = v[0] becomes num1 = 1
and num2 = v[1] becomes num1 = 2
if (num1 > num2) this condition is false so program moves to the statement:
for (int i = 2; i < size; ++i)
current = v[i]; becomes current = v[2]; which is current = 3
if (current < num1) is false so program moves to :
else if(current < num2) this is also false.
So the program moves to the statement:
cout<<num1<< " "<<num2<< endl;
which prints these two numbers 1 and 2 on output screen as the two smallest integers in the list in ascending order. Hence the output of the program is:
1 2
The screenshot of output of the program is attached.
Answer:
integers=[]
while True:
number=int(input())
if number<0:
break
integers.append(number)
print("",min(integers))
print("",max(integers))
Explanation:
Fix the 2 error codes.
1 // DebugSix2.java
2 // Display every character between Unicode 65 and 122
3 // Start new line after 20 characters
4 public class DebugSix2
5 {
6 public static void main(String args[])
7 {
8 char letter;
9 int a;
10 final int MIN = 65;
11 final int MAX = 122;
12 final int STOPLINE1 = 85;
13 final int STOPLINE2 = 122;
14 for(a = MIN; a <= MAX; a++)
15 letter = (char)a;
16 System.out.print(" " + letter);
17 if((a == STOPLINE1) & (a == STOPLINE2))
18 System.out.println();
19 System.out.println("\nEnd of application")
20 }
21 }
1 // DebugSix4.java
2 // Displays 5 random numbers between
3 // (and including) user-specified values
4 import java.util.Scanner;
5 public class DebugSix4
6 {
7 public static void main(String[] args)
8 {
9 int high, low, count;
10 final int NUM = 5;
11 Scanner input = new Scanner(System.in);
12 // Prompt user to enter high and low values
13 System.out.print("This application displays " + NUM +
14 " random numbers" +
15 "\nbetween the low and high values you enter" +
16 "\nEnter low value now... ");
17 low = input.nextInt();
18 System.out.print("Enter high value... ");
19 high = input.nextInt();
20 while(low == high)
21 {
22 System.out.println("The number you entered for a high number, " +
23 high + ", is not more than " + low);
24 System.out.print("Enter a number higher than " + low + "... ");
25 high = input.nextInt();
26 }
27
28 while(count < low)
29 {
30 double result = Math.random();
31 // random() returns value between 0 and 1
32 int answer = (int) (result * 10 + low);
33 // multiply by 10 and add low -- random is at least the value of low
34 // only use answer if it is low enough
35 if(answer <= low)
36 {
37 System.out.print(answer + " ");
38 ++count;
39 }
40 }
41 System.out.println();
42 }
43 }
Answer:
See Explanation
Explanation:
Considering the first program: DebugSix2.java
The following statement needs to be terminated
System.out.println("\nEnd of application")
as
System.out.println("\nEnd of application");
Then, the loop needs to be enclosed as this:
for(a = MIN; a <= MAX; a++){
letter = (char)a;
System.out.print(" " + letter);
if((a == STOPLINE1) & (a == STOPLINE2))
System.out.println();}
Considering the first program: DebugSix4.java
You only need to initialize variable count to 0 as this:
count = 0
I've added the correct source code as an attachment
Omar is preparing to deliver a presentation to his class. It is about a program to collect samples from an asteroid that has been set up by the National Aeronautics and Space Administration. As he checks the spelling, PowerPoint identifies the name of the asteroid Bennu as a misspelled word.
Which option should Omar click in the Spell Checker pane so that PowerPoint does not identify the asteroid’s name as a misspelled word again?
Add
Change
Change All
Ignore Once
Answer:
Its A
Explanation:
On Edg
Answer:
A is the answer
Explanation:
it just is.
2.) Multiple choice questions
1. Which function key is used to update the total in cell?
(a) F7
(b) f8
(c) f9
2. The intersection of a column and row is called a
(a) Border
(b) table
(c) cell
3. Tables group is present on the
tab.
(a) layout
(b) insert
(c) home
4. Which key combination moves the cursor to the previous cell?
(a) Tab + alt
(b) shift + tab (c) none of these
5. Which style affects the selected text within a paragraph?
(a) Character style (b) paragraph style
(c) built-in style
Answer:
The answer to this question is given below in the explanation section.
Explanation:
Which function key is used to update the total in cell?
(a) F7
(b) f8
(c) f9
The intersection of a column and row is called a
(a) Border
(b) table
(c) cell
Tables group is present on the tab.
(a) layout
(b) insert
(c) home
Which key combination moves the cursor to the previous cell?
(a) Tab + alt
(b) shift + tab
(c) none of these
5. Which style affects the selected text within a paragraph?
(a) Character style
(b) paragraph style
(c) built-in style
Which filter allows you to impart a stamping or raising effect in an image?
A. Stylize filter
B. Noise filter
C. Sharpen filter
D. Blur filter
E. Texture filter
Answer:
A. Stylize filter
Explanation:
I took the test on edmentum your welcome.
Answer:
Is B because noisse feltrr✔️
Which number is equivalent to 72.5e-2?
0.725
72.5
7.25
7250
Answer:
.725
Explanation:
You are going back 2 spaces.
Answer:
0.725
Explanation:
Edge 2022
How computer can affect the life of people?
Which IEEE standards define Wi-Fi technology?
network standards
802.11 standards
111.82 standards
fidelity standards
Answer:
802.11 standards
the answer is:
b. 802.11 standards
Which type of network involves buildings in multiple cities connecting to each other?
Answer:
Power lines
Explanation:
Because their everywhere
Answer:
WAN
Explanation:
A network consisting of multiple LANs in
separate locations.
A company with LANs in three major cities, all
connected through WAN links, usually leased from a
telecommunications provider
Which of these options is an example of a nested structure?A.
for loop
B.
while loop
C.
if-then-else loop
D.
if else inside a for loop
Answer:
D. if else inside a for loop
Explanation:
Finally, Su uses the last slide of her presentation as a summary slide. She wants to make sure the text she types automatically fits into the text box without changing the text box.
Which tool can Su use to accomplish this task?
Under which heading is the autofit feature found?
Which option should Su choose?
Answer:
Format Shape pane
Text Options
Shrink text on overflow
Explanation:
Answer:
Format Shape pane
Text Options
Shrink text on overflow
Explanation:
100%
The early success of Microsoft was cemented by the release of which software product:
A) Altair BASIC
B) MS-DOS for the IBM PC
C) IBM’s OS/360
D) P/M
Answer:
MS-DOS for the IBM PC
Explanation:
Shortly after its launch most personal computer companies adopted MS-DOS as their operating system.
Answer:
basically B
Explanation:
the person above is correct
Consider the following class declaration: public class Square { private double sideLength; public double getArea() { return sideLength * sideLength; } public double getSideLength() { return sideLength; } } Assuming that a no-arg constructor already exists, write an overloaded constructor for this class. It should accept an argument that is copied into the sideLength field. The parameter’s name is s.
Answer:
Here is the constructor:
public Square(double s) { //constructor name is same as class name
sideLength = s; } //s copied into sideLength field
Explanation:
The above constructor is a parameterized constructor which takes a double type variable s as argument. The name of constructor is same as the name of class.This constructor requires one parameters. This means that all declarations of Square objects must pass one argument to the Square() constructor as constructor Square() is called based on the number and types of the arguments passed and the argument passed should be one and of type double.
Here is where the constructor fits:
public class Square {
private double sideLength;
public Square(double s) {
sideLength = s; }
public double getArea() {
return sideLength * sideLength;}
public double getSideLength() {
return sideLength; } }
Your computer crashed, and you lost many personal and work-related files. You just got a new computer, but you are now much more concerned about viruses and other security threats. Which strategy can help you protect your computer against virus attacks?
Answer choices
A Disable your Web browser's automatic security settings so you can manually control the content you download.
B Open email attachments only from unknown senders.
C Update the definitions on your anti-virus application frequently.
D Perform regular backups of your hard drive.
PLS HELP!
WILL MARK BRAINLIEST!
:)
Answer: c
Explanation:
c
What is the solubility of an empty soda can
Answer:
Around 2.2 grams.
Explanation:
2.2 g CO2∗1 mol CO244 g CO2=0.05 mol
355 mL∗1 L1000 mL=0.355 L
So here we can see we have about 0.05 mol/0.355 L or about 0.14 mol of carbon dioxide per liter of soda. Of course this value varies by manufacturer, type of drink, container, etc.
4.5 Code Practice
Write a loop that inputs words until the user enters STOP. After each input, the program should number each entry and print in this format:
(This code must be in python, also if a minor explanation can be added to the bottom that would be nice. But also long as u can help I will be fine)
i = 0
while True:
user_input = input("Please enter the next word: ")
if user_input == "STOP":
break
i += 1
print("#{}: You entered {}".format(i,user_input))
print("All done. {} words entered.".format(i))
First we set i equal to zero so that we can keep track of how many words we input.
We set while True so that its a continuous loop until a certain condition is met to break out of the loop.
user_input is set equal to whatever word the user enters.
our if statement tells us to break out of the while loop if the user inputs "STOP"
If the user does not enter STOP i is set equal to itself plus 1. This just means we add one to i for every new word entered.
Then we print whichever word is entered.
After the while loop, we print All done and the quantity of words entered.
Answer:
c = 0
word = input("Enter a word: ")
while word!="STOP":
c = c+1
print("#" + str(c) + ": You entered "+str(word))
word = input("Please enter the next word: ")
print("All done. "+str(c)+" words entered.")
Surrendering to digital distractions will likely result in better grades true or false
Answer:
False
Explanation:
Being distracted isn't gonna result in better grades
To follow the Principle of Least Privilege, Set-UID programs often permanently relinquish their root privileges if such privileges are not needed anymore. Moreover, sometimes, the program needs to hand over its control to the user; in this case, root privileges must be revoked. The setuid() system call can be used to revoke the privileges. According to the manual, "setuid() sets the effective user ID of the calling process. If the effective UID of the caller is root, the real UID and saved set-user-ID are also set". Therefore, if a Set-UID program with effective UID 0 calls setuid(n), the process will become a normal process, with all its UIDs being set to n. When revoking the privilege, one of the common mistakes is capability leaking. The process may have gained some privileged capabilities when it was still privileged; when the privileged is downgraded, if the program does not clean up those capabilities, they may still be accessible by the non-privileged process. In other words, although the effective user ID of the process becomes non-privileged, the process is still privileged because it possesses privileged capabilities. Compile the following program, change its owner to root, and make it a Set-UID program. Run the program as a normal user, and describe what you have observed. Will the file /etc/zzz be modified? Please explain your observation.