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
  • 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...

  • 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.

  • C# Sharp for Visual Studio Need Expert help -to use Video studio to write a Quiz....

    C# Sharp for Visual Studio Need Expert help -to use Video studio to write a Quiz. The quiz is multiple choice with 10 questions. I need a source code to start and I can copy and paste my questions. EX: using System; namespace Quiz     class MainClass     {         public static void Main(string[] args)         {         Console.WriteLine("Welcome to the Quiz!");             Console.WriteLine("");                 // Declare variables implicitly and explicitly             var Question 1= "How many trees in a forest?");                var Answer1a = "3"                    var Answer1b ="5"...

  • c++ microsoft visual studio Write a function that given a string it will return the number...

    c++ microsoft visual studio Write a function that given a string it will return the number of vowels in the string. Function prototype is given by: int getNumVowels(string s1);

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
ADVERTISEMENT