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
PIT_PIT [208]
2 years ago
13

Does anyone know how to write this right? This is for a coding class and I’m super confused on it.

Computers and Technology
1 answer:
vovangra [49]2 years ago
4 0

Answer:

This is using c++ syntax, you might need to make slight adjustment for other languages.

First activity:

string firstSnack = "chips";

string secondSnack = "pizza";

string thirdSnack = "apples";

string bestSnack =  firstSnack;

bestSnack = secondSnack;

Second activity:

double apple = 0.5;

double banana = 0.75;

double orange = 1.43;

double total = apple + banana + orange;

Explanation:

When first declaring a variable, you want to specify the type (such as int, double, string, bool, etc.) and then the name. You can set the variable value in the declaration, or you can set it to a value later in the program by not having the equals sign and whatever comes next.

You might be interested in
Write 2 paragraphs. 1 comparing Shrek the movie and Shrek the musical and another contrasting them.
kvv77 [185]
The movie was way better, though the actors in tge musical did a good job. Shrek
8 0
3 years ago
Read 2 more answers
Why is the yellow light blinking on the front of my computer
Yanka [14]

Answer:

that means it needs to get charged or it's on airplane mode not sure what else it could be

6 0
2 years ago
Which part of project management considers if employees will work at home or in the office?
gregori [183]

Answer: i think its resources

Explanation:

5 0
2 years ago
Read 2 more answers
When you heat a pot on a stove, the handle gets warm. which type of heat transfer is possible
valina [46]

Answer:

conduction

Explanation:

The handle will warm up until it's total heat losses equal the total heat coming in. Heat comes in mostly by conduction from the body of the pot.

5 0
3 years ago
Read 2 more answers
Write a method reverse that takes an array as an argument and returns a new array with the elements in reversed order. Do not mo
mr Goodwill [35]

Answer:

public class ArrayUtils

{

//function to reverse the elements in given array

public static void reverse(String words[])

{

//find the length of the array

int n = words.length;

//iterate over the array up to the half

for(int i = 0;i < (int)(n/2);i++)

{

//swap the first element with last element and second element with second last element and so on.

String temp;

temp = words[i];

words[i] = words[n - i -1];

words[n - i - 1] = temp;

}

}

public static void main(String args[])

{

//create and array

String words[] = {"Apple", "Grapes", "Oranges", "Mangoes"};

//print the contents of the array

for(int i = 0;i < words.length;i++)

{

System.out.println(words[i]);

}

//call the function to reverse th array

reverse(words);

//print the contents after reversing

System.out.println("After reversing............");

for(int i = 0;i < words.length;i++)

{

System.out.println(words[i]);

}

}

Explanation:

4 0
2 years ago
Other questions:
  • Use search engines and websites to research the following WAN technologies to complete the table below:
    7·2 answers
  • In the beginning of a presentation, it is important to:
    9·1 answer
  • Why is the len ( ) function useful when using a loop to iterate through a stack?
    6·1 answer
  • AWT
    7·1 answer
  • Which objects appear on the slide after she clicks OK? Check all that apply.
    13·1 answer
  • What are the defenses to protect against these attacks?
    13·1 answer
  • Does anyone know how to fix this???
    11·1 answer
  • Which of the following statements about the relationship between hardware and software is true? a) Hardware can be present in in
    9·1 answer
  • Is e commerce a challenge or opportunity to the freight forwarder
    8·1 answer
  • How many pages is 1500 words double spaced 12 font?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!