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

  Different entities or objects, logical process

Different entities or objects, logical process, data flows, and data stores that are involved starting from the time of submitting a time sheet

  Find a recurrence relations

Find a recurrence relations and initial conditions for the number of bit strings of length n that do not contain three consecutive zeros . please explain full

  Define a class called blogentry

Define a class called BlogEntry that could be used to store an entry for a Web log. The class should have instance variables to store the poster's username, text of the entry, and the date of the entry using the Date class.

  Produce an identical product

There are two firms in a market that produce an identical product. Each firm has either one or zero units to sell. The probability of having a unit to sell is q and the probability of having no units to sell is 1-q. There is a single consumer ..

  Write a function named daycount() that accepts a month

Write a function named daycount() that accepts a month, day, and year as its input arguments.

  Business continuity plans and disaster recovery

In recent years, organizations have witnessed the impact of having effective and non-effective business continuity plans and disaster recovery plans. In today's environment, with significant potential natural disasters, terrorist threats, and othe..

  How many fragments are generated in link that has mtu

How many fragments are generated? What are values in the various fields in IP datagrams generated realted to fragmentaion?

  Create a program that uses linq to xml

You are asked to create a program that uses LINQ to XML to display the contents of the above XML document. You may use the Elements methods, and other common traversal methods. However, as a catch, you should know the ontology of your document and..

  Write an ebnf rule that describes the while statement

Write an EBNF rule that describes the while statement of C++. Write the recursive-descent subprogram in C++ for this rule.

  Find and display the largest of a list of positive numbers

solve the problem by using raptor. Find and display the largest of a list of positive numbers entered by the users. The user should indicate that he/she has finished entering numbers by entering a 0.

  Discuss the costs and support considerations of the web

Based on your research, write a 6-8 page paper that researches the use, adoption, and implementations of two different Web server technologies. The paper should also discuss the costs and support considerations of the Web server applications.

  Executing a shell script

Use vim (Lab Manual, page 34) to create a file named short with the follow¬ing line in it: echo 'hi there'

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