Function definitions

Assignment Help Basic Computer Science
Reference no: EM13888661

C++ problem.   Hi there,  I am having problems figuring out my lnk2019 error. below is my code.  I am using visual studio 2012 premium.

// Week 5 Assignment-1
// Description: correct 8 errors
//----------------------------------

//**begin #include files************
#include // provides access to cin and cout


#include // provides access to time() for srand()
//--end of #include files-----------
//----------------------------------

using namespace std;
//----------------------------------

//**begin function prototypes*******
double func1( int[]);
bool func2();
int func3();
//--end of function prototypes------
//----------------------------------

//**begin global constants**********
const int ArraySize = 10;
//--end of global constants---------
//----------------------------------

//**begin main program**************
int main()
{
// seed random number generator
srand(time(NULL));
// create and initialize variables
string myString;
int myInt;
//bool myBool;
int myIntArray[ArraySize];

// initialize the array with random numbers 1-100
for (int &i:myIntArray)
{
i = (rand()%100) + 1;
}
// calling the functions
for (int i = 0; i {
myInt = func1( myIntArray);
cout }
cout for (int i = 0; i {
int ranNum = (rand()%3);
cout }
// Wait for user input to close program when debugging.
cin.get();
return 0;
}
//--end of main program-------------
//----------------------------------

//**begin function definitions******
double func1()
{
return int (rand()%ArraySize);
}

bool func2()
{
return rand()%2?true:false;
}

string func3( int anInt)
{
switch (anInt)
{
case 0:
return "ZERO.";
break;
case 1:
return "ONE.";
break;
case 2:
return "TWO.";
break;
default:
break;
}
return "Not Found.";
}
//--end of function definitions------

Reference no: EM13888661

Questions Cloud

Explain how the companies are positioned strategically : Explain how the companies are positioned strategically and to what extent their actions affect one another. Explain why these companies would want to become employers of choice.
Forward contract with a portfolio of stock : Replicate a long position in this forward contract with a portfolio of stock and T-bills, giving details on the initial position as well as the trade resolution in 6 months.
Guitar at every price point for every skill level, : We offer a guitar at every price point for every skill level, explains Kevin Lello, vice president of marketing at Washburn Guitars.
Choose a topic directly related to california : Choose a topic directly related to CALIFORNIA
Function definitions : C++ problem.   Hi there,  I am having problems figuring out my lnk2019 error. below is my code.  I am using visual studio 2012 premium. // Week 5 Assignment-1// Description: correct 8 errors
Compare shipment contracts with destination contracts : Compare and contrast shipment contracts with destination contracts. What does it mean to have an insurable interest in goods to cover risk of loss?
Strategic plan for stroke in african american community : Strategic Plan for Stroke in African American Community
Early computer systems relied on command line interfaces : Early computer systems relied on command line interfaces to perform all actions. Today, the majority of systems use direct manipulation rather than a command line interface. The goal of designing a direct manipulation interface is to make use of the ..
What is the american dream and does it still exist? : What is the American dream and does it still exist?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd