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

  Write java method takes integer array and fills the array

Write a Java method which takes an integer array parameter and fills the array with random numbers between 1 and 1000, including 1 and 1000.

  Write a recursive method that returns the total number

Write a recursive method that returns the total number of handshakes that took place in a room with n people.

  Why you believe the trend of threats

Explain why you believe the trend of threats targeting large enterprises is rising and what you believe is the greatest tool these hackers have at their disposal. Provide a rationale.

  Explain order processing program to keep track

You're asked to implement an Order Processing program to keep track of orders for customers and process them if needed. The program will read a text file containing customer orders in arbitrary order and then process them Class Design

  Components of computer network

What is a computer network, what are its components and types?

  Write a sequential search function to search for a number

Write a sequential search function to search for a number in the unsorted array created in 1a. Count the number of comparisons and display the count at the end of the search. Test the search function by searching for the number 101.

  Manages the deletion of users

To do some basic administration work using common tools and configure/ install a package-Write down the command you would enter to create a account for the staff member Steven Jobs. The user should have a home directory in /homeand should belong to..

  Determine degree of statical indeterminacy

Is it statically determinate? If it is not statically determinate, determine its degree of statical indeterminacy? b) Determine the member forces roughly by assuming that diagonal members can't carry compressive loads.

  What is maximum size of a file can be stores in file system

This file system has 12 direct disk blocks, as well as single, double, and triple indirect disk blocks. What is the maximum size of a file that can be stores in this file system?

  What are techniques to use in planning presentation

You prepared and distributed a system requirements document, and you anticipate some intense questioning at the meeting. When planning your presentation, what are some techniques you will use?

  Write program mips assembly calculate fibonacci series

I want to write program in MIPS Assembly Language to calculate first 100 terms in Fibonacci series.

  The acquisition of software is complex for various reasons

The acquisition of software is complex for various reasons: an organization may have any number of software applications, which keep changing over time

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