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
rodikova [14]
4 years ago
12

A significant and powerful aspect of the java language is the: (points : 1)

Computers and Technology
1 answer:
Elodia [21]4 years ago
7 0
 <span>A significant and powerful aspect of the Java language is the: D. Object program. Java is inherently object-oriented, which means that Java programs are made up of programming elements called objects. [ [ Simply put, an object is a programming entity that represents either some real-world object or an abstract concept.</span>
You might be interested in
Explain default dictionary in microsoft word​
seraphim [82]
The default custom dictionary is the dictionary to which Microsoft Word adds the word when you do this.
4 0
3 years ago
Implement the following logic in C++, Use appropriate data types. Data types are represented as either numeric (num) or string.
ICE Princess25 [194]

Answer:

Follows are the modified code in c++ language:

#include<iostream>//header file

#include<string>//header file

using namespace std;

int main()//main method

{

string name,address, MSG_YES, MSG_NO;//defining string variable

int item,quantity,size=6, i=0;//defining integer variable

double price;//defining double variable  

int VALID_ITEM[]={106,108,307,405,457,688};//defining integer array and assign value

double VALID_ITEM_PRICE[]={0.59,0.99,4.50,15.99,17.50,39.00};//defining double array and assign value

bool foundIt=false;//defining bool variable  

MSG_YES="Item available";//use string variable to assign value

MSG_NO = "Item not found"; //use string variable to assign value

cout<<"Input name: ";//print message

cin>>name;//input value in string variable

cout<<"Input Address: ";//print message

cin>>address;//input value in string variable

cout<<"Input Item: "<<endl;//print message

cin>>item;//input value in string variable

cout<<"Input Quantity: "<<endl;//print message

cin>>quantity;//input value in string variable

while(i <size)//defining while that checks i less then size  

{

if (item ==VALID_ITEM[i]) //use if block to match item in double array

{

foundIt = true;//change bool variable value

price = VALID_ITEM_PRICE[i];//hold item price value in price variable  

}

i++;//increment the value of i

}

if (foundIt == true)//use if to check bool variable value equal to true

{

cout<<MSG_YES<<endl;//print value

cout<<"Quantity "<<quantity<<" at "<<"Price "<<price<<"each"<<endl;//print value

cout<<"Total"<<quantity*price;//calculate the total value

}

else//else block

cout<<MSG_NO;//print message  

}

Output:

please find the attached file.

Explanation:

In the above given C++ language modified code, four-string variable " name, address, MSG_YES, and MSG_NO", four integer variable "item, quantity, size, and i", and "integer and double" array is defined, that holds values.

In the string and integer variable "name, address, and item, quantity", we input value from the user-end and use the while loop, which uses the if block to check the "item and quantity" value from the user end and print its respective value.

6 0
4 years ago
The purpose of a ________ is to extract data from operational systems and other sources, clean the data, and store and catalog t
NeTakaya

Answer:

The correct answer for the following question will be Data warehouse.

Explanation:

Data warehouse (DWH), is a facility provided to data analyze and for managing and controlling an organization's business intelligence tools, pull data from many sources together for survey and analysis. It helps to store the former information and allows making better information for organization. This is also known as Enterprise Data Warehouse (EDW)

3 0
3 years ago
2- (8 point) Write a program using the instructions below. Assume that integers are stored in 4 bytes. a) Define an array of typ
lakkis [162]

Answer:

a)  

int apples [5] = {2, 4, 6, 8, 10};

b)

int *aPtr   //this is the pointer to int

Another way to attach a pointer to a an int variable that already exists:

int * aPtr;

int var;

aPtr = &var;

c)

for (int i = 0; i < size; i++){

       cout << values[i] << endl;    }

d)  

   aPtr = values;

   aPtr = &values[0];    

both  the statements are equivalent

e)

If its referring to the part d) then the address is:

cout<<aPtr;

f)

     for (int i = 0; i < size; ++i) {

            cout<<*(vPtr + i)<<endl;    }

g)

   cout << (aPtr + 3) << endl;  // address referenced by aPtr + 3

   cout << *(aPtr + 3) << endl; // value stored at that location

This value stored at location is 8

h)

    aPtr = &apples[4];

    aPtr -= 4;

    cout<<aPtr<<endl;

    cout<<*aPtr<<endl;  

Explanation:        

a)

int apples [5] = {2, 4, 6, 8, 10};

In this statement the array names is apples, the size of the array is specified in square brackets. so the size is 5. The type of array apples is int this means it can store integer elements. The values or elements of the array apples are even integers from 2 to 10. So the elements of array are:

apples[0] = 2

apples[1] = 4

apples[2] = 6

apples[3] = 8

apples[4] = 10

b)

In this statement int *aPtr  

The int* here is used to make the pointer aPtr points to integer object. Data type the pointer is pointing to is int. The asterisk symbol used with in makes this variable aPtr a pointer.

If there already exists an int type variable i.e. var and we want the pointer to point to that variable then declare an int type pointer aPtr and aPtr = &var; assigns the address of variable var to aPtr.

int * aPtr;

int var;

aPtr = &var;

c)

The complete program is:

int size= 5;

int values[size] = {2,4,6,8,10};

for (int i = 0; i < size; i++){

       cout << values[i] << endl; }

The size of array is 5. The name of array is values. The elements of array are 2,4,6,8,10.

To print each element of the values array using array subscript notation, the variable i is initialized to 0, because array index starts at 0. The cout statement inside body of loop prints the element at 0-th index i.e. the first element of values array at first iteration. Then i is incremented by 1 each time the loop iterates, and this loop continues to execute until the value of i get greater of equal to the size i.e. 5 of values array.

The output is:

2

4

6

8

10

d)

aPtr = values;

This statement assigns the first element in values array to pointer aPtr. Here values is the address of the first element of the array.

aPtr = &values[0];    

In this statement &values[0] is the starting address of the array values to which is assigned to aPtr. Note that the values[0] is the first element of the array values.

e)

Since &values[0] is the starting address of the array values to which is assigned to aPtr. So this address is the physical address of the starting of the array. If referring to the part d) then use this statement to print physical address is aPtr pointing to

cout<<aPtr;

This is basically the starting address of the array values to which is assigned to aPtr.

The output:

0x7fff697e1810                

f)

i variable represents offset and corresponds directly to the array index.

name of the pointer i.e. vPtr references the array

So the statement (vPtr + i) means pointer vPtr that references to array values plus the offset i array index that is to be referenced. This statement gives the address of i-th element of values array. In order to get the value of the i-th element of values array, dereference operator * is used.  It returns an ith value equivalent to the address the vPtr + i is pointing to. So the output is:

2

3

6

8

10

g)

values[0] is stored at 1002500

aPtr + 3 refers to values[3],

An integer is 4 bytes long,

So the address that is referenced by aPtr + 3 is

1002500 + 3 * 4 = 1002512

values[3] is basically the element of values array at 3rd index which is the 4th element of the array so the value stored at that referred location  is 8.

h)

Given that aPtr points to apples[4], so the address stored in aPtr is

1002500 + 4 * 4 = 1002516

aPtr -= 4  is equivalent to aPtr = aPtr - 4

The above statement decrements aPtr by 4 elements of apples array, so the new value is:

1002516 - 4 * 4 = 1002500

This is the address of first element of apples array i.e 2.

Now

cout<<aPtr<<endl; statement prints the address  referenced by aPtr -= 4 which is 1002500  

cout<<*aPtr<<endl;  statement prints the value is stored at that location which is 2.

6 0
4 years ago
Imagine you're developing a Pokemon game, and you need to implement the battle party mechanic. Recall that the player's party ca
valina [46]

Answer:

Complete code is given below and output is also attached.

Explanation:

import java.util.ArrayList;

import java.util.HashMap;

import java.util.Iterator;

import java.util.Map;

import java.util.Set;

public class Test {

  public static void main(String[] args) {

      String [] names = {"Pikachu", "Venuasur", "Charizard", "Blastoise", "Lapras", "Sonarlax"};

      int[] levels = {88, 84, 84, 84, 80, 82};

     

      ArrayList<HashMap<String, Integer>> party = createParty(names, levels);

     

      //looping through the list

      for(HashMap<String, Integer> i: party) {

         

          Set set = i.entrySet();

          Iterator itr = set.iterator();

          //showing output

          while(itr.hasNext()) {

              Map.Entry mentry = (Map.Entry)itr.next();

              System.out.println(mentry.getKey()+" "+mentry.getValue());

          }

      }

  }

  private static ArrayList<HashMap<String, Integer>> createParty(String[] names, int[] levels) {

      ArrayList<HashMap<String, Integer>> party = new ArrayList<>();

     

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

          //creating new hashmap

          HashMap<String, Integer> pokemon = new HashMap<>();

          pokemon.put(names[i], levels[i]);//adding pokemon

          party.add(pokemon);//adding it to the list

      }

     

      return party;

  }

}

4 0
4 years ago
Other questions:
  • Building relationships during your career exploration is called
    9·2 answers
  • On an Ethernet, a ____ is broadcast to every device but is accepted only by the device to which it is addressed.
    5·1 answer
  • Ron is the IT director at a medium-sized company and is constantly bombarded by requests from users who want to select customize
    5·1 answer
  • The two ways to use the help menu is by searching of the contents or searching the _____
    13·2 answers
  • PLEASE HELP
    9·2 answers
  • To use the AutoCalculate area, select the range of cells containing the numbers for a calculation you want to verify and then pr
    7·1 answer
  • 100 Base-T: Group of answer choices
    11·1 answer
  • A problem associated with old drivers is:
    8·1 answer
  • Cú pháp câu lệnh xóa thủ tục
    12·1 answer
  • Type the correct answer in the box. Spell all words correctly. Which language should you use to add functionality to web pages?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!