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
a printer's accessory list includes a maintenance kit with a variety of replaceable parts you should install after 100,000 pages
Triss [41]

Answer:

Laser printer

Explanation:

This is a guess based on experience, but laser printers have rollers, drums, and other various parts that need periodic replacement.

See page 87 of https://www.laserpros.com/img/manuals/hp-manuals/hp-lj-4100-manual.pdf for an example.

4 0
2 years ago
Which of the following answers refers to a system containing mappings of domain names to various types of data, such as numerica
BartSMP [9]

Answer:

DNS or Domain Name System

Explanation:

You can query a DNS server with a domain name to get an IP address.

5 0
3 years ago
Which of the following is best known as a business network LinkedIn, Facebook, Twitter or Word Press?
Maslowich
The answer is LinkedIn.
 LinkedIn manage your personal identity. It also build and engage in your professional network. It access knowledge, insights and opportunities. It links people, skills and opportunities to create world largest crowd business creation system.

7 0
3 years ago
By default, the windows desktop display
MrRissso [65]
By default, the windows desktop display the following icons/programs

1. Your Recycle Bin
2. My Computer
3. The Internet Explorer
4. The default Windows Background
5. Your windows menu
6. My Documents
7. Your task bar
8. Time (located at bottom right)
6 0
3 years ago
When saving a memo you created in Word, which of the following extensions is automatically assigned to the document?
Lena [83]
.docx is the default file extension on a Word doc.
6 0
3 years ago
Read 2 more answers
Other questions:
  • A compound document contains _______ from different applications.
    12·2 answers
  • The picture that graphically since the items you use in windows is called
    7·1 answer
  • Which word processing file that contains text and other
    13·2 answers
  • Audio editing software contains several codecs that allow you to
    15·1 answer
  • Write a program that prompts the user to input five decimal numbers. The program should then add the five decimal numbers, conve
    5·1 answer
  • What is the largest value that can be represented by 6 binary digits? .
    5·1 answer
  • Write a class called TextProcessor that implements the methods listed below. Your implementation may use the charAt() and length
    14·1 answer
  • There are many ways you can improve the performance of a website from an SEO perspective. When it comes to link building, which
    15·1 answer
  • A user complains that the pointer movement on his laptop computer is very erratic what should you do?
    9·1 answer
  • Which statement best explains the way that similar apps are used in different devices?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!