1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
koban [17]
3 years ago
12

Write a c program to print all possible marking schemes of 15 questions each with 3.

Computers and Technology
1 answer:
andrey2020 [161]3 years ago
3 0

Answer:

#include <math.h>

#include <stdio.h>

#include <string.h>

#define BASE 3

#define NRQUESTIONS 15

void toABC(int n, char* buf, int base, int size) {

   memset(buf, 'A', size);

   buf[size] = 0;

   while (n && size) {

       buf[--size] = 'A' + (n % base);

       n /= base;

   }    

}

int main()

{

   char buf[16];

   for (int i = 0; i < pow(BASE, NRQUESTIONS); i++) {

       toABC(i, buf, BASE, NRQUESTIONS);

       printf("%s\n", buf);

   }

}

Explanation:

Assuming 3 is the number of possible answers to choose from for each question.

I tackled this by having an integer counter enumerate all values from 0 to 3^15, and then convert each integer to a base-3 representation, using ABC in stead of 012.

You might be interested in
The average number of entities completed per unit time -- the output rate -- from a process is called ____.
Sergio039 [100]

Answer:

Throughput.

Explanation:

The average number of entities completed per unit time -- the output rate -- from a process is called throughput.

Basically, throughput is a technical term used to describe the amount of data that can be transmitted or transferred from one place to another in a specific period of time. It is used to measure or determine the performance of RAM and hard drives.

8 0
3 years ago
What were the names of Henry VIII's six wives?
timurjin [86]

Answer:

Jane Seymour,Anne Boleyn,Katherine of Aragon,Anne of Cleves,Katherine Howard,Katherine Parr

Explanation:

7 0
2 years ago
Read 2 more answers
There are about what licensed drivers here in Florida
arsen [322]
 There are about 15,000,006
6 0
3 years ago
What statement best describes operating systems?
arlik [135]

Answer: D) Operating Systems manage the computer's random access memory (RAM)

Explanation:

It's not A because all modern computers use some form of an Operating System.

It's not B because some Operating Systems can cost hundreds of dollars.

While C has some truth to it, it's reversed. Operating Systems are there to manage and allocate system resources, and D is the better choice.

6 0
3 years ago
Write a program that asks the user to enter a number of seconds. There are 60 seconds in a minute. If the number of seconds ente
frez [133]

Answer:

// here is code in c.

#include <stdio.h>

// main function

int main()

{

// variable to store seconds

long long int second;

printf("enter seconds:");

// read the seconds

scanf("%lld",&second);

// if seconds is in between 60 and 3600

if(second>=60&& second<3600)

{

// find the minutes

int min=second/60;

printf("there are %d minutes in %lld seconds.",min,second);

}

// if seconds is in between 3600 and 86400

else if(second>=3600&&second<86400)

{

// find the hours

int hours=second/3600;

printf("there are %d minutes in %lld seconds.",hours,second);

}

// if seconds is greater than 86400

else if(second>86400)

{

// find the days

int days=second/86400;

printf("there are %d minutes in %lld seconds.",days,second);

}

return 0;

}

Explanation:

Read the seconds from user.If the seconds is in between 60 and 3600 then find the minutes by dividing seconds with 60 and print it.If seconds if in between 3600 and 86400 then find the hours by dividing second with 3600 and print it. If the seconds is greater than 86400 then find the days by dividing it with 86400 and print it.

Output:

enter seconds:89

there are 1 minutes in 89 seconds.

enter seconds:890000

there are 10 days in 890000 seconds.

8 0
3 years ago
Other questions:
  • In what ways us cyberspace is real? list at least 3 examples to support your response .
    9·1 answer
  • How do I connect my CSS file and HTML page together? it's just not wanting to work for me. 
    5·1 answer
  • using C++ to sort user input. for example, user enter 25numbers and sort them from small to big or big to small, cout thesamlles
    6·1 answer
  • 2. From the listing code, please give the block of line numbers for code which are concerned with the following: A) Main functio
    5·1 answer
  • Which option should you select to ignore all tracked changes in a document? To ignore all tracked changes in a document, you sho
    15·2 answers
  • Suppose you're currently completing an examination online. When you're finished, you click on Reset Exam. Why would you do this?
    8·1 answer
  • .What particular skills does a team leader need in addition to the other skills needed by any team member. (choose all that appl
    6·1 answer
  • What is the purpose of a Post Mortem Review? (5 points)
    5·1 answer
  • Radio spectrum is the part of the complete range of electromagnetic waves that is used for radio communication from
    14·1 answer
  • Select all the correct answers.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!