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
Sergio [31]
3 years ago
15

Which of the following statements contains an error?

Computers and Technology
1 answer:
ASHA 777 [7]3 years ago
5 0
I. is syntactically correct if genderString exists. if genderString, for example, is "Male", then char gender would be the character at index 0 (the first character), meaning 'M'.

II. is incorrect. It is using the comparison operator (==) instead of the assignment operator (=). It is also setting a boolean variable to a String value of 'F'. Boolean values cannot hold string values, and can only hold true & false. 

III. is correct if ageString only contains numbers (presumably, it does, as it's called ageString). Integer.parseInt is a function that converts String values to integer values if the string values only contain numerical characters.

The answer in this case should be B. II only.
You might be interested in
Apakah ada yang bisa menjelaskan potongan source code ini?
GarryVolchara [31]

This code attempts to fuse two strings together. So,

fuse("Apple", "Banana")

would return "ABpapnlaen a"

However, there are a couple of things wrong with this code:

- The for loop is incomplete (probably a copy paste error)

- It is unclear from the code if the array jawaban will overflow if kata1 and kata2 are large (it probably will)

- Biggest problem: the jawaban array is declared on the stack, which means it will be cleaned up when the function returns. So the caller of this function will reference unallocated memory! This is a huge bug!!

6 0
3 years ago
How technology bacome the mode of revealing​
maria [59]

Answer:

afefdasf

Explanation:

3 0
2 years ago
Write a program that allows the user to play a guessing game. The game will choose a "secret number", a positive integer less th
Burka [1]

Answer:

// This program is written in C++

// Comments are used for explanatory purpose

// Program starts here

#include<iostream.h>

#include<stdlib.h>

int main()

{

// Declare variables

int num, selectno;

string status;

randomize();

//Generate random number;

num=rand()%10000;

// Prompt to guess a number

cout<<"You have only 10 tries\nTake a guess: ";

int tries = 0;

while (tries != 10)

{

cin>>selectno;

if(selectno == num){

cout<<"You passed at the "<<count+1<<" attempt";

tries = 10;

}

else

{

cout<<"You failed. Take another guess\n You have "<<10 - count + 1 <<" attempts";

}

tries++;

if(tries >= 10)

{

break;

}

}

return 0;

}

8 0
2 years ago
a. Fill in the blanks with suitable words: A software that controls and manages all the activities of the computer ... b. A soft
zavuch27 [327]

Explanation:

i don't know

4 0
2 years ago
what is one example of the decomposers taking from the ecosystem and one of them giving to the ecosystem
adelina 88 [10]
Like when a seed drops on the ground, and a bee come to take some honey. It sticks to the bee and where the bee goes, the bee will rub it off and the seed will start to grow.
8 0
2 years ago
Other questions:
  • Lance has three tables in his database he wants to generate a report to show the data from the three table so he decides to link
    6·2 answers
  • i will be doing an interview to someone so plz comment down below something random and you will automatically enter
    11·1 answer
  • Create a detail report that will display all SCR courses in alphabetical order, with the course name and the instructor name in
    5·1 answer
  • In Python, arrays are usually reserved for
    12·1 answer
  • Which DHCPv4 message will a client send to accept an IPv4 address that is offered by a DHCP server? (Points : 5) Unicast DHCPACK
    8·1 answer
  • How many times would the following loop iterate?
    15·1 answer
  • How is the bootstrap program started?
    6·2 answers
  • What is a special type of variable used in subroutines that refers to a piece of data?
    15·1 answer
  • Where does the list of incoming mail appear in gmail
    13·2 answers
  • What is microsoft excel​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!