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]
2 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]2 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
Define the missing function. licenseNum is created as: (100000 * customID) licenseYear, where customID is a function parameter.
Mumz [18]

Answer:

Written in Python:

def licenseNum(licenseYear, customID):

    output = 100000 * customID + licenseYear

    print("Dog license: "+str(output))

 

Explanation:

This line defines the function with parameters licenseYear and customID

def licenseNum(licenseYear, customID):

This calculates the output as stated in the question

    output = 100000 * customID + licenseYear

This displays the output

    print("Dog license: "+str(output))

To call the function, make use of: licenseNum(2014, 777)

Where 2014 and 777 can be replaced with other digits as required

6 0
3 years ago
3) An example of interactive web page is<br>​
FinnZ [79.3K]

Answer:

face book is an interactive website, because you can interact with the content such as give a like or comment.

6 0
2 years ago
Numeric data is stored in what for direct processing
Ede4ka [16]
A string variables??? I'm not sure does this have any multiple choice 
3 0
3 years ago
To hide the ribbon, ______ on any one of the tabs of the ribbon.
Natasha_Volkova [10]
The ribbon is a set of toolbars at the top of the window in Office programs designed to help you quickly find the commands that you need to complete a task. Sometimes the ribbon can get hidden and it's hard to find. The quickest way to show the ribbon is to click on any visible tab, like Home<span>, </span>Insert<span> or </span>Design<span>. You might also want to hide the ribbon to maximize screen space.</span>
8 0
3 years ago
Your computer is crashing on a regular basis. Which of the following is an operation available to the user that should help rese
Neko [114]

Answer

System restore

Explanation

System restore is a recovery feature that helps restore your system to the previous condition or point. Most computers have system restore disks which are an advantage to the users especially when the computer clashes.These disks are very effective when it comes to restoring the system to its initial state.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Why are many otherwise safety-conscious people victims of Internet crime?
    13·1 answer
  • What would you use to compare two date ranges in a report?
    9·1 answer
  • Name types of operating system with example
    5·1 answer
  • Nikolas has a idea that he could use the compressed carbon dioxide in a fire extinguisher to propel him on his skateboard. Nikol
    13·2 answers
  • )What is proceduralabstraction, and why is it important inComputer Science
    14·1 answer
  • The program is to be answered in Java Programming not C++ Please answer the following: Modify the BarChart program to accept the
    6·1 answer
  • Write pseudocode to represent the logic of a program that allows a user to enter three values then outputs the product of the th
    8·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    15·2 answers
  • New and just need help with C coding. I've tried if statements and it outputs the wrong number.
    6·2 answers
  • At the heart of every computing device is a(n) _______________, which is usually a single, thin wafer of silicon and tiny transi
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!