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
Novosadov [1.4K]
2 years ago
7

Your team at amazon is overseeing the design of a new high-efficiency data center at hq2. a power grid need to be generated for

supplying power to n servers. all servers in the grid have to be connected such that they have access to power. the cost of connections between different servers varies. assume that there are no ties, names of servers are unique, connections are directionless, there is at most one connection between a pair of servers, all costs are greater than zero, and a server does not connect to itself. write an algorithm to minimize the cost of connecting all servers in the power grid. input two arguments - num, an integer representing number of connections. connectons, representing a list of connections where each element of the list consists of two servers and the cost of connection between the servers. note: the cost of connection between the servers is always greater than 0.
example input num = 5 connection = [[a,b,1], [b,c,4], [b,d,6], [d,e,5], [c,e,1]]

output [[a,b,1], [b,c,4], [c,e,1], [d,e,5]]
Computers and Technology
1 answer:
elixir [45]2 years ago
3 0

Answer:

void print2(int row) {

for (int i = 0; i < row; i++) {

 char ch = 'a';

 char print = ch;

 for (int j = 0; j <= i; j++) {

  cout << print++;

 }

 cout << endl;

}

}

int count_digits(int num) {

int count = 0;

int temp = num;

while (temp != 0) {

 temp = temp / 10;

 count++;

}

return (num % count);

}

Explanation:

You might be interested in
Using reliable internet sources, identify three ways we use analog and digital signals in our everyday lives.
Montano1993 [528]
Clocks maybe is the answer. I really don’t know
7 0
3 years ago
Michelle works as a contractor for Gamer Geniuses, Inc., a company that creates educational games for children ages 3-10 years o
AlladinOne [14]

Answer:

Its syntax error

Explanation:

4 0
2 years ago
in chapter 10, the class clocktype was designed to implement the time of day in a program. certain applications, in addition to
Ivan

A program to test your class is given below:

<h3>The Program</h3>

#include <iostream>

class clockType

{

public:

void set_hour(int h);

int get_hour();

void set_minut(int m);

int get_minut();

void set_second(int s);

int get_second();

clockType() {};

clockType(int h,int m,int s)

{

 h = ((h < 0) ? 0 : (h > 23) ? 23 : h);

m = ((m < 0) ? 0 : ( m> 59) ? 59 : m);

 s = ((s< 0) ? 0 : (s > 59) ? 59 : s);

 hour = h;

 minut = m;

 second = s;

}

private:

int hour{ 0 };

int minut{ 0 };

int second{ 0 };

};

inline void clockType::set_hour(int h)

{

h = ((h < 0) ? 0 : (h > 23) ? 23 : h);

hour = h;

}

inline void clockType::set_minut(int m)

{

m = ((m < 0) ? 0 : (m > 59) ? 59 : m);

minut = m;

}

inline void clockType::set_second(int s)

{

s = ((s < 0) ? 0 : (s > 59) ? 59 : s);

second = s;

}

inline int clockType::get_minut()

{

return minut;

}

inline int clockType::get_second()

{

return second;

}

inline int clockType::get_hour()

{

return hour;

}

int main()

{

// example test program

// set time 22:54:12

clockType test(22, 54, 12);

std::cout << "Set time :" << test.get_hour() << "h" << test.get_minut() << "m" << test.get_second() << "s" << std::endl;

// set time 18:18:54

test.set_hour(18);

test.set_minut(18);

test.set_second(54);

std::cout << "Set time :" << test.get_hour() << "h" << test.get_minut() << "m" << test.get_second() << "s" << std::endl;

system("pause");

return 0;

}

Read more about programming here:

brainly.com/question/23275071

#SPJ1

5 0
1 year ago
The program 4 should first tell users that this is a word analysis file. For any user-given text file, the program will read, an
djverab [1.8K]

Answer:

See explaination

Explanation:

import os,string

def readfile(filename):

if os.path.isfile(filename) is not True:return None

line_number=1

word_dict={}

print('Text File to be analyzed: {}'.format(filename))

with open(filename,'r') as infile:

for line in infile.readlines():

words = line.strip().split()

for word in words:

word = word.strip(string.punctuation)

if word.strip()=='':continue

if word_dict.get(word)==None:

word_dict[word]=[line_number]

else:

line_number_list=word_dict.get(word)

line_number_list.append(line_number)

line_number+=1

return word_dict

def write_to_file(word_dict,filename):

with open(filename,'w') as outfile:

for word in sorted(word_dict.keys()):

outfile.write('{0}:\t\t{1}\n'.format(word,','.join([str(n) for n in word_dict.get(word)])))

def main():

filename='D:\\Word.txt'

output_filename='D:\\word_index.txt'

word_dict = readfile(filename)

if word_dict ==None:

print('Unable to read file {}'.format(filename))

else:

for word in sorted(word_dict.keys()):

print('{0}:\t\t{1}'.format(word,','.join([str(n) for n in word_dict.get(word)])))

write_to_file(word_dict,output_filename)

main()

7 0
3 years ago
Which of the following statements about CASE is not true?CASE tools provide automated graphics facilities for producing charts.C
katrin [286]

Answer:

CASE tools reduce the need for end user participation in systems development.

Explanation:

CASE is an acronym for Computer-aided Software Engineering and it comprises of software application tools that provide users with automated assistance for Software Development Life Cycle (planning, analysing, designing, testing, implementation and maintenance). The CASE tools helps software developers in reducing or cutting down of the cost and time of software development, as well as the enhancement of the software quality.

Some other benefits of using the CASE tools are;

- CASE tools provide automated graphics facilities for producing charts.

- CASE tools have capabilities for validating design diagrams and specifications.

- CASE tools support collaboration among team members.

- CASE tools facilitate the creation of clear documentation.

- CASE tools checks for consistency, syntax errors and completeness.

The CASE tools can be grouped as, requirement and structure analysis, software design, test-case and code generation, reverse engineering, and document production tools.

Examples of CASE tools are flowchart maker, visible analyst (VA), dreamweaver, net-beans, microsoft visio, adobe illustrator and photoshop etc.

4 0
3 years ago
Other questions:
  • A general rule for adding text to a slide is ____.
    7·2 answers
  • Do you think that people accept poor quality in information technology projects and products in exchange for faster innovation?
    13·1 answer
  • _____________ data is what is translated to digital format so it can be stored in a computer.
    10·1 answer
  • If you have configured your prompt so that it does not show your working directory, you can use the ____ command to verify in wh
    15·1 answer
  • What’s my password for this app
    6·2 answers
  • Define a function compute gas volume that returns the volume of a gas given parameters pressure, temperature, and moles. Use the
    7·2 answers
  • What is the core function of an enterprise platform
    12·2 answers
  • Java question
    15·1 answer
  • KSJEDHGYGVWJHMJ,RHGFYDOYWUGWHBJK
    13·1 answer
  • in the future, mobile technologies are expected to be used more than desktop computers today. what other improvements are helpin
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!