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
Rainbow [258]
3 years ago
6

"Write one statement that declares an integer variable numHouses initialized to 25."

Computers and Technology
1 answer:
katrin [286]3 years ago
7 0

Answer:

int numHouses = 25;

Explanation:

The answer above is the Java and C++ prgramming languages' method of declaring and assinging a value to a variable.

To declare a variable, the variable type is written first , this could be (int for Integer, char for characters, double for decimal numbers, etc.), then followed by the name the programmer chooses to give to the variable which must not be a keyword or reserved word. The equality opereator performs the assignment operation of  assigning a value to the variable in this case 25.

int numHouses = 25;

int  is the variable type

numHouses  is the variable name

= is the assignment operator

25 is the assigned value

You might be interested in
The IntList class contains code for an integer list class. Study it; notice that the only things you can do are: create a list o
torisob [31]

Explanation:

public class Int_List

{

protected int[] list;

protected int numEle = 0;

 

public Int_List( int size )

{

list = new int[size];

public void add( int value )

{

if ( numEle == list.length )

{

System.out.println( "List is full" );

}

else

{

list[numEle] = value;

numEle++;

}

}

public String toString()

{

String returnStr = "";

for ( int x = 0; x < numEle; x++ )

{

returnStr += x + ": " + list[x] + "\n";

}

return returnStr;

}

}

public class Run_List_Test

{

public static void main( String[] args )

{

 

Int_List myList = new Int_List( 7 );

myList.add( 102 );

myList.add( 51 );

myList.add( 202 );

myList.add( 27 );

System.out.println( myList );

}

}

Note: Use appropriate keyword when you override "tostring" method

8 0
2 years ago
public class N extends String, Integer { } When you compile, you get the following message: N.java:1: ‘{‘ expected public class
GREYUIT [131]

Correct Question:

Public class N extends String, Integer { } When you compile, you get the following message: N.java:1: ‘{‘ expected public class N extends String, Integer ^ 1 error Explain what the problem is and how to fix it.

Note the capital letter P

Answer and Explanation:

Problem: This is a syntax error, the key word "public" should begin with a small letter and not capital letter.

How to fix: Replace the capital letter P by  small letter p and recompile.

8 0
3 years ago
NOS stands for _____.
Andre45 [30]

there are different ones like

Not Otherwise Specified

Network Operating System

5 0
3 years ago
2. Write a program with a function that accepts a string as an argument and returns a copy of the string with the first characte
Oduvanchick [21]

Answer:

Following are the code to this question:

def capital(val):#defining a method that takes string value as parameter

   x=True#defining boolean variable

   r=''#defining string variable  

   for i in val:#defining loop to convert the first character into upper case

       if i.isalpha() and x:#defining condition to check input value is string

           r=r+i.upper()#change value into uppercase and hold value in r variable

           x=False#assign value false in boolean variable

       elif i=='.' or i=='?' or i=='!':#check symbols

           r=r+i#add value in r variable

           x=True#assign value True in boolean variable

       else:

           r=r+i#add all value in r variable

   return r#return r variable value

val=input()#input value in val variable

print(capital(val))#called the function which print the return value

Output:

please find the attachment.

Explanation:

  • In the above python program, a method "capital" is declared, which accepts a "val" a string value in its parameter, and inside the method one boolean "x" and one string "r" variable is used, in which r stores return value.
  • In the next step, for loop is declared, inside the loop, the conditional statement is used, in if the block it checks string value and converts the first character into upper case and assigns value false in the boolean variable.  
  • In the next step, elif block is defined that adds value in r variable and at the last, it will return function value, at the last step "val" variable is declared that input value from the user and pass into the method and print its return value.

4 0
2 years ago
Homework 8 Matlab Write a function called fibonacciMatrix. It should have three inputs, col1, col2, and n. col1 and col2 are ver
Amiraneli [1.4K]

In this exercise we have to use the knowledge in computational language in python to write the following code:

We have the code can be found in the attached image.

So in an easier way we have that the code is:

<em>function v = myfib(n,v)</em>

<em>if nargin==1</em>

<em>    v = myfib(n-1,[0,1]);</em>

<em>elseif n>1</em>

<em>    v = myfib(n-1,[v,v(end-1)+v(end)]);</em>

<em>end</em>

<em>end</em>

<em>function v = myfib(n,v)</em>

<em>if nargin==1</em>

<em>    v = myfib(n-1,[0,1]);</em>

<em>elseif n>1</em>

<em>    v = myfib(n-1,[v,v(end-1)+v(end)]);</em>

<em>elseif n<1</em>

<em>    v = 0;</em>

<em>end</em>

<em>function [n] = abcd(x)</em>

<em>if (x == 1 || x==0)</em>

<em>    n = x; </em>

<em>    return</em>

<em>else</em>

<em>    n = abcd(x-1) + abcd(x-2);</em>

<em>end</em>

<em>end</em>

<em>fibonacci = [0 1];</em>

<em>for i = 1:n-2</em>

<em>    fibonacci = [fibonacci fibonacci(end)+fibonacci(end-1)];</em>

<em>end</em>

<em>>> myfib(8)</em>

<em>ans =</em>

<em>    0    1    1    2    3    5    8   13</em>

<em>>> myfib(10)</em>

<em>ans =</em>

<em>    0    1    1    2    3    5    8   13   21   34</em>

See more about python at  brainly.com/question/18502436

8 0
2 years ago
Other questions:
  • Which of the following is NOT a group on the Slide Master tab?
    6·1 answer
  • Blackbaud is a company that supplies services and software designed for nonprofit organizations. Which type of e-commerce websit
    8·1 answer
  • Jerry’s managing a Google Search campaign and would like to improve the position in which his ads appear. He’s increased his bid
    15·1 answer
  • Name the six parts of the product development life cycle.
    7·2 answers
  • E-What is the important of Recycle bin?<br>Ans:​
    12·1 answer
  • Win10如何删除自己添加的环境变量?...............
    8·1 answer
  • How r u<br> ;)<br> happy what day is it
    5·2 answers
  • Can anyone figure this out???? I need help ASAP!
    8·1 answer
  • What are the minimum number of bits an address bus must have in a byte addressable memory system containing only 4 KiB of memory
    8·1 answer
  • Html is a markup language that lets you identify common sections of a web page
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!