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
Kruka [31]
3 years ago
7

Write a complete program that declares an integer variable, reads a value from the keyboard into that variable, and writes to st

andard output the square of the variable's value.
Computers and Technology
1 answer:
vovikov84 [41]3 years ago
5 0

Answer:

#include <iostream>

using namespace std;

int main ()

{

int num;

cin>>num;

cout << num<< " " << 2 num << " " << numnum;

return 0;

}

Explanation:

See answer

You might be interested in
Which of the following types of software applications would open a file
Mumz [18]
It’s C. An MP3 file is an audio/video file, so only a media player would be able to play this
8 0
4 years ago
Which of the following statements about the continue statement is true?
kotykmax [81]

Answer:

Option (d)

Explanation:

  • The Continue statement is used inside the looping statements.
  • When a Continue statement is encountered inside the loop, it stops executing the current iteration ( it skips the next steps in the current iteration) and goes to the next iteration.
  • It then continues to execute the loop for the next iteration.
  • The continue statement can be used in all the looping structures ( for loop, while loop, do while loop ).
  • The syntax for continue statement is " continue; "
  • Options (a),(b),(c) are wrong options.
  • Option (d) is correct option.
8 0
3 years ago
Write a function wordcount() that takes the name of a text file as input and prints the number of occurrences of every word in t
artcher [175]

Answer:

Explanation:

The following Python program uses a combination of dictionary, list, regex, and loops to accomplish what was requested. The function takes a file name as input, reads the file, and saves the individual words in a list. Then it loops through the list, adding each word into a dictionary with the number of times it appears. If the word is already in the dictionary it adds 1 to its count value. The program was tested with a file named great_expectations.txt and the output can be seen below.

import re

def wordCount(fileName):

   file = open(fileName, 'r')

   wordList = file.read().lower()

   wordList = re.split('\s', wordList)

   wordDict = {}

   for word in wordList:

       if word in wordDict:

           wordDict[word] = wordDict.get(word) + 1

       else:

           wordDict[word] = 1

   print(wordDict)

wordCount('great_expectations.txt')

4 0
3 years ago
Add the following methods to the ArrayCollection class, and create a test driver for each to show that they work correctly. In o
maks197457 [2]

Answer:

Attached are screenshots of the working code - baring in mind this only works on mutable Collection types. (ones that can be changed) if you use Collections that don't support this you may experience an Unsupported Operation Exception - but this is expected.

Explanation:

Using Java streams as an alternative for some answers.

3 0
3 years ago
What type of open source programming language is python
Vlada [557]

Answer:

Python is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use. Python's license is administered by the Python Software Foundation.

Explanation:

g00gle

3 0
2 years ago
Other questions:
  • How many bytes are in 1 kilobyte of storage
    13·1 answer
  • When using correct ergonomic technique be sure to
    6·2 answers
  • Members of the sales team use laptops to connect to the company network. While traveling, they connect their laptops to the inte
    15·1 answer
  • Ano ang humahati ng globo ng equdor
    8·1 answer
  • If a program compiles fine, but it produces an incorrect result, then the program suffers from _______________.
    11·1 answer
  • In a black box model are the customers told that they should be expecting to be haxked?
    13·1 answer
  • Hello i need help whats -5 = 500
    13·2 answers
  • How would I collect a number from the user to use for the radius of a circle?
    13·1 answer
  • What is output by the following code?
    13·1 answer
  • What does business informWhat does business information management do?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!