Question

This requires the Use of Microsoft Visual Studio and Using the C language and I need...

This requires the Use of Microsoft Visual Studio and Using the C language and I need any help I can for the following project:

93b9cfd396.png

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hi, Please find my program.

Please let me know in case of any issue:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

int main(){

   // generating random wumpus
   int wloc, num;
   srand(time(NULL));
   wloc = rand()%7 + 65;
   num = rand()%7 + 1;
   char location = (char)wloc;
   //printf("%c%d\n",location,num);

   // to store user input
   char userGuess[5];

   printf("Guess the position\n");
   while(1){

       scanf("%s", userGuess);
       // if user input size is exactly 2
       if(strlen(userGuess) == 2){

           if(userGuess[0] == location && (userGuess[1]-'0') == num){
               printf("You found the wumpush!\n");
               break; // stop
           }
       }

       printf("Try again\n");
   }

   return 0;
}

secondweek gcc wumpus.c secondweek./a.out ЕЗ Guess the position A4 Try again 334 Try again E33 Try agair V4 Try again ЕЗ You

Add a comment
Know the answer?
Add Answer to:
This requires the Use of Microsoft Visual Studio and Using the C language and I need...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need help building a program on microsoft visual studio using c++ language. implement a program...

    I need help building a program on microsoft visual studio using c++ language. implement a program called "charword_freq.cpp" to determine the number of words and the number of occurrences of each letter in a block of text stored in a data file called “mytext.dat”. Define a word to be any string of letters that is delimited at each end by either whitespace, a period, a comma, or the beginning or end of a line. You can assume that the input...

  • The questions below deal with Microsoft Visual Studio 2012 Reloaded, under the Visual Basic programming language....

    The questions below deal with Microsoft Visual Studio 2012 Reloaded, under the Visual Basic programming language. The book ISBN number that I am using is: 978-1-285-08416-9 or the UPC code is: 2-901285084168-1. Question 1 Visual Basic 2012 is an object-oriented programming language, which is a language that allows the programmer to use ____________________ to accomplish a program�s goal. Question 2 An application that has a Web user interface and runs on a server is called a(n) ____________________ application. Question 3...

  • READ CAREFULLY: ONLY .ASM (aka Microsoft VISUAL STUDIO) DO NOT ATTEMP TO USE WRONG FORMAT SUCH...

    READ CAREFULLY: ONLY .ASM (aka Microsoft VISUAL STUDIO) DO NOT ATTEMP TO USE WRONG FORMAT SUCH AS NASM I DO NOT NEED GLOBAL_START ETC..... SAMPLE FORMAT BASED ON IRVINE TEXTBOOK .data .code iplement the following expression in assembly language:             for (i = 5; i > 0; i--)      {                                for(j = 3; j > 0; j--)                                           { y = i + j ;           }       } Assume I and j are 32-bit registers and y is a list.

  • I need to create a bubble sort program for the numbers 1,2,3,4,5 in assembly language using...

    I need to create a bubble sort program for the numbers 1,2,3,4,5 in assembly language using Microsoft visual studio

  • this is assembly language for x-86 processors using microsoft visual studio Create a procedure named FindThrees...

    this is assembly language for x-86 processors using microsoft visual studio Create a procedure named FindThrees that returns 1 if an array has three consecutive values of 3 somewhere in the array. Otherwise, return 0. The procedure’s input parameter list contains a pointer to the array and the array’s size. Use the PROC directive with a parameter list when declaring the procedure. Preserve all registers (except EAX) that are modified by the procedure. Write a test program that calls FindThrees...

  • Use Microsoft Visual Studio C# only, don't need a GUI. Use Console interface Danielle, Edward, and...

    Use Microsoft Visual Studio C# only, don't need a GUI. Use Console interface Danielle, Edward, and Francis are three salespeople at Holiday Homes. Write an application named HomeSales that prompts the user for a salesperson initial (D, E, or F). Either uppercase or lowercase initials are valid. While the user does not type Z, continue by prompting for the amount of a sale. Issue an error message for any invalid initials entered. Keep a running total of the amounts sold...

  • using Microsoft Visual Studio C++ write a compute program that will allow the user to: 1.Get...

    using Microsoft Visual Studio C++ write a compute program that will allow the user to: 1.Get a Factorial (using a loop) 2. perform addition and subtraction 3.allow the user to quit the program

  • C++ and Using Microsoft Visual Studio. Write 2 programs: One program will use a structure to...

    C++ and Using Microsoft Visual Studio. Write 2 programs: One program will use a structure to store the following data on a company division: Division Name (East, West, North, and South) Quarter (1, 2, 3, or 4) Quarterly Sales The user should be asked for the four quarters' sales figures for the East, West, North, and South divisions. The data for each quarter for each division should be written to a file. The second program will read the data written...

  • Can someone help me with this problem. We're using microsoft visual studios and its from my...

    Can someone help me with this problem. We're using microsoft visual studios and its from my assembly code language class. we're using this template in class from the lecture slides Write a program and verify it using visual studio that does the following: Use type, lengthof, and size to make your program more independent of the data type. 3) Write a program that first reads the message entered by the user and stores it in Myname. Then it prints the...

  • Using assembly language in microwoft visual studio write the following code with procedure with c...

    using assembly language in microwoft visual studio write the following code with procedure with correct number of Fib numbers Your program should detect the largest Fib number that can be calculated. Besides storing the result in an array, print them on the screen.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT