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

Create a dynamic array of 100 integer values named myNums. Use a pointer variable (like ptr) which points to this array. Use thi

s pointer variable to initialize the myNums array from 2 to 200 and then display the array elements. Delete the dynamic array myNums at the end. You just need to write part of the program.
Computers and Technology
1 answer:
11111nata11111 [884]3 years ago
5 0

Answer:

The required part of the program in C++ is as follows:

int *ptr;

int *myNums = new int(100);

srand (time(NULL));

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

 myNums[i] = rand() % 200 + 2; }

ptr = myNums;

cout << "Output: ";

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

 cout <<*(ptr + i) << " "; }

delete[] myNums;

Explanation:

This declares a pointer variable

int *ptr;

This declares the dynamic array myNums

int *myNums = new int(100);

This lets the program generate different random numbers

srand (time(NULL));

This iterates through the array

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

This generates an integer between 2 and 200 (inclusive) for each array element

 myNums[i] = rand() % 200 + 2; }

This stores the address of first myNums in the pointer

ptr = myNums;

This prints the header "Output"

cout << "Output: ";

This iterates through the pointer

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

Print each element of the array, followed by space

 cout <<*(ptr + i) << " "; }

This deletes the dynamic array

delete[] myNums;

You might be interested in
What features are provided by most GUIs?
PSYCHO15rus [73]

Windows is the answer

8 0
4 years ago
Where do players resurrect if they have been destroyed in a game?
CaHeK987 [17]

Usually back to their start point. Or a random place on the map.

3 0
4 years ago
all of the following are new technology-related trends in mis except: group of answer choices the mobile digital platform. iot.
Bess [88]

The option that is note a new technology-related trends in MIS is co-creation of business value.

<h3>Technology and Management Information System:</h3>

Technology and Management Information System is known to be a term that connote the way a person can know or understand data that is obtained from a lot of units and departments of an organization.

Note that It can be used in the area of integration with other types of technology and as such, The option that is note a new technology-related trends in MIS is co-creation of business value.

Learn more about  business value from

brainly.com/question/25528419

#SPJ1

5 0
2 years ago
Shawn thought that the screen of the block-based program he was using was
Alja [10]

Answer:

Interface

Explanation:

Definition- "The interface of a particular piece of computer software is its presentation on the screen and how easy it is to operate. <em>...the development of better user interfaces.</em>"

7 0
3 years ago
Write a function named “createPurchaseOrder” that accepts the quantity (integer), the cost per item(double), and the description
Leona [35]
#include
Program: using namespace std;
string createPurchaseOrder0;
int main(
{
cout<return 0;
}
string createPurchaseOrder(
{
int qty;
double costPerltem;
string description,info="":
cout<<"Enter Quantity:
cin>>qty;
cout<<"Enter cost per item: "
cin>>costPerltem;
cout<<"Enter Description: "
cin>>description;
if(qty<0 I| costPerltem<0
Idescription.compare(''"')==0)
cout<<'InThe entered data is invalid!":
info="":
else
"
cout<<"'InThe entered data is valid!":
info=info+"'(nQuantity: "+to_string (qty) +" In";
info=info+"Cost per item:
"†to_string (costPerltem)+"In";
info=info+"Description: "description+" In";
return info;

Output:
4 0
3 years ago
Other questions:
  • When writing a personal narrative, what point of view would be best to use? (1 point) first person second person third person th
    10·2 answers
  • What is the protocol in the web search at the bottom?
    13·1 answer
  • Name three types of data stored on a computer’s hard disk
    11·1 answer
  • How do you ask brainy a question without it not liking the question and saying it hurts their feelings?
    14·1 answer
  • The scheme function (mult2-diff Ist) should take one argument, a list of numbers, and results in multiplying each number in the
    11·1 answer
  • While surfing online, Patricia checks her email and reads the latest messages. She then browsers a website and logs in a comment
    8·1 answer
  • Write a statement that increases the value of the int variable total by the value of the int variable amount. that is, add the v
    5·1 answer
  • What do the buttons on the paste options menu do
    11·1 answer
  • Read the scenario below, and then answer the question.
    13·1 answer
  • Explain the different features available in Print command?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!