Write a program that prompts the user to enter the name of a text file, uses...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that prompts the user to enter the name of a text file, uses the filename to open and read the file contents, and then displays the number of occurrences of each alphabetic letter in the file. Letters are case insensitive. Here's a sample run using the attached billOfRights.txt file: For the ADA compliant version of this image, please select the file Assignment_Files & Arrays_Image Alt Text The contents of the bill of Rights.txt file has the following character count: Number of As: 290 Number of Bs: 84 Number of Cs: 134 Number of Ds: 146 Number of Es: 563 Number of Fs: 125 Number of Gs: 68 Number of Hs: 193 Number of Is: 310 Number of Js: 8 Number of Ks: 6 Number of Ls: 164 Number of Ms: 97 Number of Ns: 322 Number of Os: 319 Number of Ps: 91 Number of Qs: Number of Rs: 262 Number of Ss: 296 Number of Ts: 443 Number of Us: 115 Number of Us: 4253592126 49 Number of Ws: 52 Number of Xs: 11 Number of Ys: 52 Number of Zs: The Bill of Rights Congress of the United States, begun and held at the City of New York, on Wednesday the fourth of March, one thousand seven hundred and eighty nine. THE Conventions of a number of the States, having at the time of their adopting the Constitution, expressed a desire, in order to prevent misconstruction or abuse of its powers, that further declaratory and restrictive clauses should be added: And as extending the ground of public confidence in the Government, will best ensure the beneficent ends of its Institution. RESOLVED by the Senate and House of Representatives of the United States of America, in Congress assembled, two thirds of both Houses concurring, that the following Articles be proposed to the Legislatures of the several States, as amendments to the Constitution of the United States, all, or any of which Articles, when ratified by three fourths of the said Legislatures, to be valid to all intents and purposes, as part of the said Constitution; viz. ARTICLES in addition to, and Amendment of the Constitution of the United States of America, proposed by Congress and ratified by the Legislatures of the several States, pursuant to the fifth Article of the original Constitution. Amendment I Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances. Amendment II A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms, shall not be infringed. Amendment III No Soldier shall, in time of peace be quartered in any house, without the consent of the Owner, nor in time of war, but in a manner to the prescribed by law. Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment V No person shall be held to answer for a capital, or otherwise infamous crime, unless on a presentment or indictment of a Grand Jury, except in cases arising in the land or naval forces, or in the Militia, when in actual service in time of War or public danger; not shall any person be subject for the same offence to be twice put in jeopardy of life or limb; nor shall be compelled in any criminal case to be a witness against himself, nor be deprived of life, liberty, or property, without due process of law; nor shall private property be taken for public use, without just compensation. Amendment VI In all criminal prosecutions, the accused shall enjoy the right to a speedy and public trial, by an impartial jury of the State and district wherein the crime shall have been committed, which district shall have been previously ascertained by law, and to be informed of the nature and cause of the accusation; to be confronted with the witnesses against him; to have compulsory process for obtaining witnesses in his favor, and to have the Assistance of Counsel for his defense. Amendment VII In Suits at common law, where the value in controversy shall exceed twenty dollars, the right of trial by jury shall be preserved, and no fact tried by a jury, shall be otherwise re- examined in any Court of the United States, than according to the rules of the common law. Amendment VIII Excessive bail shall not be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted. Amendment IX The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people. Amendment X The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people. Essential Facts about the Bill of Rights The Bill of Rights consists of the first ten amendments to the United States Constitution The United States Constitution was adopted on September 17, 1787 by the Constitutional Convention. After ratification, it took effect on March 4, 1789. Opponents of the Constitution argued that it was too vague and assigned too much power to the federal government. In some states, it was only ratified because citizens held out hope of future amendments that would more clearly limit the power of government. Supporters of the Bill of Rights saw it as a means of expressing clearly and unequivocally the rights of individual citizens while also limiting the power of government over its citizens. The framers of the Bill of Rights were influenced by the Virginia Declaration of Rights (1776), the English Bill of Rights (1689), and the Magna Carta (1215). Twelve amendments were originally proposed to the first Congress in 1789. The first two, which concerned the number of constituents required for each representative and pay for congressmen, never became law. After ratification by three-fourths of the states, the ten amendments that make up the Bill of Rights went into effect on December 15, 1791. The contents of the billofRights.txt file has the following character count Number of As: Number of Bs: 290 84 Number of Cs: 134 Number of Ds: 146 Number of Es: 563 Number of Fs: 125 Number of Gs: 68 Number of Hs: 193 Number of Is: 310 Number of Js: Number of Ks: 98 6 Number of Ls: 164 Number of Ms: 97 Number of Ns: 322 Number of Os: 319 Number of Ps: 91 Number of Qs: 4 Number of Rs: 262 Number of Ss: 296 Number of Ts: 443 Number of Us: 115 Number of Vs: 49 Number of Ws: 52 Number of Xs: 11 Number of Ys: 52 Number of Zs: 6 Write a program that prompts the user to enter the name of a text file, uses the filename to open and read the file contents, and then displays the number of occurrences of each alphabetic letter in the file. Letters are case insensitive. Here's a sample run using the attached billOfRights.txt file: For the ADA compliant version of this image, please select the file Assignment_Files & Arrays_Image Alt Text The contents of the bill of Rights.txt file has the following character count: Number of As: 290 Number of Bs: 84 Number of Cs: 134 Number of Ds: 146 Number of Es: 563 Number of Fs: 125 Number of Gs: 68 Number of Hs: 193 Number of Is: 310 Number of Js: 8 Number of Ks: 6 Number of Ls: 164 Number of Ms: 97 Number of Ns: 322 Number of Os: 319 Number of Ps: 91 Number of Qs: Number of Rs: 262 Number of Ss: 296 Number of Ts: 443 Number of Us: 115 Number of Us: 4253592126 49 Number of Ws: 52 Number of Xs: 11 Number of Ys: 52 Number of Zs: The Bill of Rights Congress of the United States, begun and held at the City of New York, on Wednesday the fourth of March, one thousand seven hundred and eighty nine. THE Conventions of a number of the States, having at the time of their adopting the Constitution, expressed a desire, in order to prevent misconstruction or abuse of its powers, that further declaratory and restrictive clauses should be added: And as extending the ground of public confidence in the Government, will best ensure the beneficent ends of its Institution. RESOLVED by the Senate and House of Representatives of the United States of America, in Congress assembled, two thirds of both Houses concurring, that the following Articles be proposed to the Legislatures of the several States, as amendments to the Constitution of the United States, all, or any of which Articles, when ratified by three fourths of the said Legislatures, to be valid to all intents and purposes, as part of the said Constitution; viz. ARTICLES in addition to, and Amendment of the Constitution of the United States of America, proposed by Congress and ratified by the Legislatures of the several States, pursuant to the fifth Article of the original Constitution. Amendment I Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances. Amendment II A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms, shall not be infringed. Amendment III No Soldier shall, in time of peace be quartered in any house, without the consent of the Owner, nor in time of war, but in a manner to the prescribed by law. Amendment IV The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized. Amendment V No person shall be held to answer for a capital, or otherwise infamous crime, unless on a presentment or indictment of a Grand Jury, except in cases arising in the land or naval forces, or in the Militia, when in actual service in time of War or public danger; not shall any person be subject for the same offence to be twice put in jeopardy of life or limb; nor shall be compelled in any criminal case to be a witness against himself, nor be deprived of life, liberty, or property, without due process of law; nor shall private property be taken for public use, without just compensation. Amendment VI In all criminal prosecutions, the accused shall enjoy the right to a speedy and public trial, by an impartial jury of the State and district wherein the crime shall have been committed, which district shall have been previously ascertained by law, and to be informed of the nature and cause of the accusation; to be confronted with the witnesses against him; to have compulsory process for obtaining witnesses in his favor, and to have the Assistance of Counsel for his defense. Amendment VII In Suits at common law, where the value in controversy shall exceed twenty dollars, the right of trial by jury shall be preserved, and no fact tried by a jury, shall be otherwise re- examined in any Court of the United States, than according to the rules of the common law. Amendment VIII Excessive bail shall not be required, nor excessive fines imposed, nor cruel and unusual punishments inflicted. Amendment IX The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people. Amendment X The powers not delegated to the United States by the Constitution, nor prohibited by it to the States, are reserved to the States respectively, or to the people. Essential Facts about the Bill of Rights The Bill of Rights consists of the first ten amendments to the United States Constitution The United States Constitution was adopted on September 17, 1787 by the Constitutional Convention. After ratification, it took effect on March 4, 1789. Opponents of the Constitution argued that it was too vague and assigned too much power to the federal government. In some states, it was only ratified because citizens held out hope of future amendments that would more clearly limit the power of government. Supporters of the Bill of Rights saw it as a means of expressing clearly and unequivocally the rights of individual citizens while also limiting the power of government over its citizens. The framers of the Bill of Rights were influenced by the Virginia Declaration of Rights (1776), the English Bill of Rights (1689), and the Magna Carta (1215). Twelve amendments were originally proposed to the first Congress in 1789. The first two, which concerned the number of constituents required for each representative and pay for congressmen, never became law. After ratification by three-fourths of the states, the ten amendments that make up the Bill of Rights went into effect on December 15, 1791. The contents of the billofRights.txt file has the following character count Number of As: Number of Bs: 290 84 Number of Cs: 134 Number of Ds: 146 Number of Es: 563 Number of Fs: 125 Number of Gs: 68 Number of Hs: 193 Number of Is: 310 Number of Js: Number of Ks: 98 6 Number of Ls: 164 Number of Ms: 97 Number of Ns: 322 Number of Os: 319 Number of Ps: 91 Number of Qs: 4 Number of Rs: 262 Number of Ss: 296 Number of Ts: 443 Number of Us: 115 Number of Vs: 49 Number of Ws: 52 Number of Xs: 11 Number of Ys: 52 Number of Zs: 6
Expert Answer:
Answer rating: 100% (QA)
Prompt the user to enter the name of a text file and read the file contents In this step we will pro... View the full answer
Related Book For
Vector Mechanics for Engineers Statics and Dynamics
ISBN: 978-0073398242
11th edition
Authors: Ferdinand Beer, E. Russell Johnston Jr., David Mazurek, Phillip Cornwell, Brian Self
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Let V be the volume of a can of radius r and height h, and let S be its surface area (including the top and bottom). Find r and h that minimize S subject to the constraint V = 54.
-
A recent single audit report for the County of Ashton contains the following: "I. Summary of Auditor's Results" (see below). Based on the content of this chapter, information contained in the AICPA...
-
What are the three basic ways in which data sets can be classified?
-
Select a publicly traded company for analysis or use a company assigned by your instructor. Using the firms most recent Form 10-K report (accessed through the SEC EDGAR database or from the companys...
-
A traveling production of Jersey Boys performs each year. The average show sells 1,000 tickets at $60 a ticket. There are 120 shows each year. The show has a cast of 75, each earning an average of...
-
Lyme Incorporated issues 3,000 shares of no-par-value common stock for $20 per share. What is the correct journal entry for this transaction?
-
You talk to Sally about getting paid for the work you're doing. You suggest $25 an hour and she agrees. You are only doing this temporarily since you have some extra time so you set yourself up as a...
-
For this project, you get to design a simple program to keep track of various video game characters. Your program will store, display and remove human characters, enemy characters and enemy "boss"...
-
A 35.0-g bullet strikes a 5.0-kg wooden block traveling 1.2 m/sec in the same direction as the bullet. If the bullet embeds itself in the block, and they move off together at 8.6 m/s. What was the...
-
Assume that instead of having available capacity, Windsor is currently operating at capacity and is selling everything it produces to its usual external customers. If Windsor takes on this special...
-
critically analyse the following in response to the emergence of Australia's gig economy: ACTU's 'Change the Rules' campaign Australian Labor party's 2019 election policy Australian Greens proposed...
-
Summarise the following south African cases for me: Public Service Association and Others v Minister of Public Service and Others [2020] ZALAC 54;[2021] 3 BLLR 255 (LAC). NUMSA v Lufil and Others...
-
How good have sponsors of infrastructure projects been in estimating costs? The literature on estimating costs for megaprojects has shown that the track record with respect to coming close to a...
-
Single Linux based web server available on the public Internet with and IP address of 90.33.30.10 and a DNS name of web1.widgets.com Customer contact: Stuart Melvin email stu@widgets.com phone...
-
As of January 1, 2018, Room Designs, Inc. had a balance of $9,900 in Cash, $3,500 in Common Stock, and $6,400 in Retained Earnings. These were the only accounts with balances in the ledger on January...
-
A uniform crate with a mass of 30 kg must be moved up along the 15° incline without tipping. Knowing that force P is horizontal, determine (a) The largest allowable coefficient of static friction...
-
The frame of a greenhouse is constructed from uniform aluminum channels. Locate the center of gravity of the portion of the frame shown. 5 ft 3 ft 2 ft
-
The 24-lb square plate shown is supported by three vertical wires. Determine (a) The tension in each wire when a =10 in., (b) The value of a for which the tension in each wire is 8 lb. 30 in 30 in
-
On August 1, 1958, first-class postage for a 1-ounce envelope was 4. On August 1, 2007, a first-class stamp for the same envelope cost 41. What was the annual compound increase in the cost of...
-
What is the present value of the following future receipts? a. $19,000 five years from now at 9 percent compounded annually b. $8,300 twelve years from now at 15 percent compounded annually c. $6,200...
-
What rate of interest compounded annually is involved if a. an investment of \($10\),000 made now will result in a receipt of \($23\),674 ten years from now? b. an investment of \($2\),000 made 18...
Study smarter with the SolutionInn App